Search
Dawn Parzych - Dawn's Blog
You are here: DevCentral > Weblogs

posted on Thursday, October 02, 2008 8:10 AM

Cache-Control headers can be sent in both the request and the response.    Cache-Control headers in the response specify whether or not the content can be cached by the user and for how long.  Cache-Control headers in a request specify whether or not a user wants to receive content served from cache, this includes disk caches and proxy caches.

The values in response Cache-Control headers can include:

  • no-cache - No system or user can cache this content.
  • private - Browser can cache this content, but shared or public caches cannot.
  • public - Content can be cached by any system not just browsers. 
  • max-age - Set in seconds; specifies the maximum amount of time content is considered fresh.

The most commonly used request based Cache-Control header is no-cache. A cache must not use a cached version of the item, without revalidation with the origin web servers.  This applies to disk cache as well as shared caches.  To see this in action use a plug-in or tool to view the HTTP headers that are sent from your browser, while using CTRL + Refresh to load a page you have previously visited.  Your request headers should look something like this:

Accept    */*
Accept-Encoding    gzip, deflate
Accept-Language    en-gb
Cache-Control    no-cache
Connection    Keep-Alive

The response code should be a 200 as opposed to a 304 or cached response.

For detailed information on all the Cache-Control headers check out rfc2616.



Feedback

No comments posted yet.

Let Me Know What You Think


Please use the form below if you have any comments, questions, or suggestions.

Title:
 
Name:
 
Email: (so we can show your gravatar)
Website:
Comment: Allowed tags: blockquote, a, strong, em, p, u, strike, super, sub, code
 
Please add 6 and 1 and type the answer here:

82,243 Members in 102 Countries and Growing!

Join DevCentral Today!

About DevCentral

DevCentral has been a successful, thriving community for many years. We have always strived to bring you the best technical documentation, discussion forums, blogs, media and much more that we can.

So dive in, get familiar with DevCentral. We hope you like it, we hope it makes your job easier, and lets you get that much more power out of the community. To learn more, make sure to check out the Getting Started section. And if you have any problems, or think something could be easier to use, drop us a line to let us know.

Got It !

We've received your comment and transmitted it directly to DevCentral HQ.

Thanks for taking time to let us know what's on your mind. At DevCentral | Community Matters!

Get In Touch With Us

Have questions, suggestions or just want to get something off your chest?

Use our handy form below to Direct Connect with DevCentral Mission Control.

Send Us Feedback       or