Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use HTTP's <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13.1.3" rel="nofollow">cache-control mechanisms</a> to control the browser's caching.</p> <p>When serving a copy of your JS file, include an <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.19" rel="nofollow">ETag</a> and/or <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.29" rel="nofollow">Last-Modified</a> header in the response. Also include a "<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9" rel="nofollow">Cache-Control</a>: must-revalidate" header. This tells the browser that it must check back with the server every time, and it can send an <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26" rel="nofollow">If-None-Match</a> and/or <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.25" rel="nofollow">If-Modified-Since</a> header in future requests to ask the server to send the file only if it's changed.</p> <p>If you'd like to avoid the load of browsers checking with the server every time, and it's OK for the changes to not take effect immediately, you can also include a <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18" rel="nofollow">Date</a> header with the current time and an <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21" rel="nofollow">Expires</a> header set to some point in the future — maybe 12 or 24 hours. That allows the browser to use its cached copy for the specified amount of time before it has to check back with your server again.</p> <p>HTTP's cache-control features are pretty robust, but there are plenty of nuances, such as controls for intermediate caches (e.g. other systems <em>between</em> your server and the user's browser). You'll want to read about <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html#sec13" rel="nofollow">caching in HTTP</a> overall, not just the specific header fields that I've mentioned.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload