Updating cached headers

All you need to do is ensure that each server response provides the correct HTTP header directives to instruct the browser on when and for how long the browser can cache the response.

If you are using a Web View to fetch and display web content in your application, you might need to provide additional configuration flags to ensure that the HTTP cache is enabled, its size is set to a reasonable number to match your use case, and the cache is persisted.

Fetching something over the network is both slow and expensive.

However, that’s inefficient because if the resource hasn't changed, then there's no reason to download the same information that's already in cache!

Check your server documentation for the necessary configuration flags.

Tip: The HTML5 Boilerplate project contains sample configuration files for all the most popular servers with detailed comments for each configuration flag and setting.

As a result, if a proper validation token (ETag) is present, no-cache incurs a roundtrip to validate the cached response, but can eliminate the download if the resource has not changed. It simply disallows the browser and all intermediate caches from storing any version of the returned response—for example, one containing private personal or banking data.

Every time the user requests this asset, a request is sent to the server and a full response is downloaded.

Leave a Reply