1

We are currently developing a website. And every time we edit "user.js" file and to see our updates we need to hard refresh the page which will cause a longer loading time because it will load all the JS, CSS and IMG again from the server. It took more than five seconds of waiting.

I can't totally disable caching so the pages will much faster 1-3 seconds.

My goal now is to know how to disable cache on specific file or files so the rest of the CSS,JS, and IMG files stays cached.

This will give us effeciency in coding.

halfer
  • 19,824
  • 17
  • 99
  • 186
Jovylle
  • 859
  • 7
  • 17
  • Answered here https://stackoverflow.com/a/50277036 – Lian Jun 12 '20 at 10:36
  • Thanks for the response, I can use this but i hope that there is a way that i can specifically exclude it temporarily on chrome because i also wanted it to stay cache if i am not developing yet. – Jovylle Jun 12 '20 at 10:55
  • Personally I would do it on the server side by checking the server url and disable cache for localhost. If that's not possible, maybe check this out: https://stackoverflow.com/a/53736881/760331 – Lian Jun 12 '20 at 11:28
  • I see, i really appreciated it, i would now be utilizing the first option you gave it is more easier than the second one, Thanks alot for your time. – Jovylle Jun 12 '20 at 11:33
  • Does this answer your question? [chrome cache removal for single files](https://stackoverflow.com/questions/11881027/chrome-cache-removal-for-single-files) – Eric Jul 14 '22 at 06:00
  • below already answer my question. If I want a file to hard refresh i just need to open that specific file on a tab and hard refresh. – Jovylle Jul 14 '22 at 10:28

1 Answers1

1

For your specific concern, this is what i do.

If you wanted to hard refresh this file every time you edit it, and without hard refreshing the whole page.

You just need to hard refresh that specific file

https://xdxd.com/user.js

Then open your page normally on new tab, and must be in new tab so the changes will apply.

That's the trick i am doing. If ever i dont want to Hard Refresh the whole website.

AvocadoFish
  • 106
  • 3