Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP headers for the most permanent caching possible

For example: a stable release of jQuery will never change until the next version. When that happens, the URL will change.

Also, images like a website logo can be cached and when it changes I simply change the URL that is used to call it.

The header I know of is

Expires: Tue, 01 Feb 2050 00:00:00 GMT

I believe there are one or more additional headers I can use to add to the caching for proxies and maybe there is something I don't know about.

Are there any other headers I should know about?

Granted the cache will get deleted beyond my control. But I want to cache as much as possible.

Also this does not cover CSS/JavaScript minify/compile and it also does not count image compression or content compression such as gzip.

like image 207
700 Software Avatar asked Feb 04 '11 17:02

700 Software


People also ask

Which HTTP caching header is used to?

Cache-control is an HTTP header used to specify browser caching policies in both client requests and server responses. Policies include how a resource is cached, where it's cached and its maximum age before expiring (i.e., time to live).

Are HTTP headers cached?

Cache-Control is a HTTP cache header that contains a set of parameters to define the browser's caching policies in the client requests and server responses. When a client makes a request to the server, the browser can cache, or store copies of resources for faster access and lower latency.

Which header offers caching control in the following HTTP response?

The Cache-Control HTTP header field holds directives (instructions) — in both requests and responses — that control caching in browsers and shared caches (e.g. Proxies, CDNs).


1 Answers

Expires is HTTP/1.0 and HTTP/1.1 introduced the more versatile Cache-Control where you can not just specify an expiration date but also cacheability and revalidation.

I recommend you to read Mark Nottingham’s Caching Tutorial.

like image 183
Gumbo Avatar answered Oct 19 '22 19:10

Gumbo