Website Cache?
- Started
- Last post
- 4 Responses
- freedom
I'm planning on relaunching a client's site and they're worried about the old site loading for past visitors? Is that something to worry about? Do you ever add a forced refresh?
- nb0
Sure, why not?
- pinkfloyd1
There's a force refresh? Is that a pop up? If there's a way to do it automatically, I'd say turn that shit on. BTW, I have no idea what i'm talking about.
- sublocked4
Generally the way you deal with this is by explicitly serving resources like CSS and JS with the proper "expires" headers.
http://stackoverflow.com/questio…
However, since you can't ever control how each browser will react - the sure way is to use a random or sequential number appended to your CSS & JS files when referenced from HTML.
Frameworks like Rails do this automatically, serving "new" versions of those resources after new deployments to the server.
You can emulate this behavior by referencing something like /your-site/css/yourstyle.css?v=2...
The server should just ignore the dynamic params, but browsers will see it as a new resource to fetch.
- fadein110
Never encountered this issue - the new website will load fine if it is different - file names etc.
Only ever had this kind of problem when an old CSS file is cached for some reason. But only ever on an existing site - not to a new one.- Happens enough to have a simple solution like outlined above. Better than having to tell clients/customers to hold shift + reload.sublocked