Is there a way that I can force a page to reload, but only if it has been updated recently? I am working on a photography website so there are a lot of images, therefore it is best if it is cached.
However, if the content has been updated (e.g. more photographs added) then I want the browser to load a fresh copy, if not then use the version in the cache?
I was hoping that there was a meta tag that would take care of it. I’ve read about the expires tag but that wouldn’t help as the page isn’t updated regularly.
I’m only using CSS, HTML and Javascript, nothing server side. Any suggestions welcome.
I think the best would be to use HTTP caching mechanisms. If you can’t use server side languages to send appropriate HTTP headers, try a built in solution like Apache’s mod_expire module. With that you can set a maximum age based on the request time: