0

I'm completely new to the caching systems, so I'm trying to find out what values I need to input to use a "last modified" system for caching. I've looked everywhere I'm able, but I can't get a straight answer on last-modified caching.

What do I need to put into the header to enable this caching method? Or is this method in use as default, hence why I can't see instructions?

Kizzycocoa
  • 39
  • 11
  • Could you provide a little more detail/description of what you mean exactly by "last modified system for caching"? That description could mean different things to different folks, so elaborating on the specific behavior/functionality you want can help us provide better solutions/answers. – Castaglia Feb 13 '16 at 03:33
  • Well, cache-control has several parameters, such as "no-cache", "Must revalidate" and "max age". these all have different functions in relation to caching pages. But how do you make it so it caches the pages until the page is modified, in which case it caches the new pages? a "last modified" system. it doesn't seem to have any value for that! – Kizzycocoa Feb 14 '16 at 16:20

1 Answers1

2

For HTTP, you might consider the use of the ETag response header and the If-None-Match request header, and/or the use of the Last-Modified response header and the If-Modified-Since header; see if-modified-since vs if-none-match for a good discussion of these techniques.

The key is for the client to know when the resource was modified; the Cache-Control directives don't really allow for proactively informing a client of when the resource was modified outside of any expiration policy, and thus other headers are needed for modification detection. That's where ETag (a value that uniquely identifies that version of the resource), and/or Last-Modified (a timestamp of when that version of the resource was last modified) come into play.

Hope this helps!

Community
  • 1
  • 1
Castaglia
  • 2,972
  • 5
  • 28
  • 49
  • This is the exact kind of answer I was looking for. thanks a lot for clarifying this! The documentation out there is really lacking. Thanks a lot! – Kizzycocoa Feb 15 '16 at 20:23