Camillia
asked on
Howcome I don't have to clear cache when I move code to production?
I've had this question for a while now...
When I make changes to JS/jQuery code and run the code locally on my laptop, I sometimes need to clear the cache to see the changes.
I have both minified and non-minified version of JS files.
When I move the code to our Production, I don't ask the users to clear their cache.
Howcome users don't have to clear their cache when I move code to Production? why do I need to clear cache only when I'm developing?
When I make changes to JS/jQuery code and run the code locally on my laptop, I sometimes need to clear the cache to see the changes.
I have both minified and non-minified version of JS files.
When I move the code to our Production, I don't ask the users to clear their cache.
Howcome users don't have to clear their cache when I move code to Production? why do I need to clear cache only when I'm developing?
When the users' systems are powered up in the morning and also when their browsers are started from scratch at the beginning of the day, their browser caches will be clear. The issue can't occur in this situation.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, guys.
Question
How would versioning help in clearing the cache?
First question is: how do you know they don't have to clear their cache?Yes, I don't know for sure.
Question
Cached JS / CSS is a common problem which is why many systems work on a principle of versioning their scripts / stylesheets by adding a parameter to the URL
?ver=123
or ?ver=time()
How would versioning help in clearing the cache?
I must respectfully disagree with Julian's comment regarding browsers and cache. Every browser I have encountered starts up with nothing in its cache, and builds the cache as it continues running.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if you have cleared the cacheIf you clear your cache the problem goes away - irrespective of whether you restart the browser or not.
ASKER
Thanks. Let me read.
ASKER
Thanks. I have another question but I'll open another thread. This helped a lot.