How it works...

Our page caching strategy relies on us having a reliable key with which we can look up pages before bothering to set up an external HTTP request. To do this for our first page, we changed our optional pageToken parameter to be automatically defined as the first page if there is no value provided. This means that, when the first page result is loaded, it will be automatically added to our cache under this key value. Then, the next time we load this component without providing a key, it will default to the first page and find and reload the cached value instead of making an HTTP request. We can reuse this solution for the same requests that provide defined pageToken parameters, so we get great flexibility from this caching solution.

It's worth noting that the first page value for this pageToken is explicitly not used for the actual HTTP request we make to the blogger API. It's an internal tracking ID that we made up for our own purposes, and passing it to the blogger API would only cause a 404 error for that pageToken.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.210.12