2

right now if you open view page source in Mozilla, you'll see an external javascript link. if you click on that link the browser will show javascript function from browser cache. but if you select view>>reload the browser will requesting to server.

on IE and Chrome you click the hyperlink from view source, it will always requesting to server. is there a way to get a same behavior on Mozilla?

EDIT

I am a webmaster, and I wonder this will be done using javascript or anything server side code.

Wladimir Palant
  • 53,866
  • 11
  • 93
  • 123
vantian
  • 770
  • 3
  • 8
  • 24

1 Answers1

2

You didn't say if you are a webmaster and want to disable caching of your scripts, or you are a web surfer and want to disable caching of script of websites that you visit.

If you are a webmaster

If you are a webmaster then you can achieve it using correct Cache-Control and Expires HTTP headers, eg. by setting Cache-Control to max-age=0 and Expires the current time. (See my answer to Determining a page is outdated on github pages for more info on how to control the caching of websites.)

Keep in mind that it will put more load on your servers and make your website load longer for your visitors and Loading Time Affects Your Bottom Line.

If you are a web surfer

If you are a visitor and want to forse the reload of cached resources then you can use many Firefox add-ons that let you control the caching of websites, for example: Clear Cache, CacheToggle, Empty Cache Button and many more.

Community
  • 1
  • 1
rsp
  • 91,898
  • 19
  • 176
  • 156