+ 1
Chrome keeps caching my files — is there a way to disable cache on my website?
Chrome keeps caching my files, especially JS files. I can disable cache on my side sometimes, and or clear caches to get around that. But I can’t be telling to “clear cache” to every user that comes to my website. :: The problem with the files being cached: When I make changes to an [html, css, JS] code, it takes a while to see the changes on the website. Because it’s (chrome—caches) still holding on the previous changes. I want to make sure that the website updates as within seconds when I click on “save changes”.
7 odpowiedzi
+ 3
Martin Taylor usually cache are limited in size, and older/less used files are deleted from it ;P
appending a query string with the date/hour (?date=202103170549) should do the trick in major of cases... however, reloading javascript file without refreshing page doesn't works ^^
+ 2
Incognito mode in Chrome gives you the choice to browse the Internet without your activity being saved to your browser or device.
Incognito mode doesn't use your existing cookie store and, at the end of the session, dumps any cookies, history, and autofill data that were generated
+ 2
You dont need to worry about the cache growing, the browser will take care of it itself.
visph answer is also a valid option, however in that case you completely disable caching, which may not be what you want. changing the filenames allows the file to be read from cache if the user reloads the page, and forces a reload if there were changes
+ 1
I’m wondering if this is something we can control with .htaccess or in some other way.
+ 1
you can change the filename of the relevant files.
bundlers like webpack usually generate a new filename on each build, eg
main_4213674312.js
+ 1
- 2
I use opera Gx you should use it too it's even more faster and better than that ram sucking chrome