Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://httpd.apache.org/docs/current/mod/mod_expires.html" rel="nofollow noreferrer">Expires</a> module in Apache solves this - it needs to be loaded in server config, and set up in <code>.htaccess</code> (or in server config).</p> <p>With an <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21" rel="nofollow noreferrer">Expires</a> header, the resource is only requested the first time. Before the expiration date, subsequent requests are fulfilled from browser cache. After the specified time expires and the resource is needed, only then it is requested again (conditionally - a 304 will be returned for an unchanged resource). The only reliable way to clear it from the cache before it expires is manually, or by forcing a refresh (usually Ctrl-F5). (This could be an issue if the resource changes in the meantime, but statical images don't change very often.)</p> <pre><code># enable the directives - assuming they're not enabled globally ExpiresActive on # send an Expires: header for each of these mimetypes (as defined by server) ExpiresByType image/png "access plus 1 month" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" # css may change a bit sometimes, so define shorter expiration ExpiresByType text/css "access plus 1 days" </code></pre> <p>For favicon.ico, a bit more work is needed (Apache normally does not recognize Windows icon files, and sends this as the default text/plain).</p> <pre><code># special MIME type for icons - see http://www.iana.org/assignments/media-types/image/vnd.microsoft.icon AddType image/vnd.microsoft.icon .ico # now we have icon MIME type, we can use it # my favicon doesn't change much ExpiresByType image/vnd.microsoft.icon "access plus 3 months" </code></pre> <p>And voila, It Works™!</p>
    singulars
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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