Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browser caching when files are served from a network file-share

As I understand it, whether an item is cached by the web browser is determined by:

  1. What the response headers tell the browser to do (e.g., Cache-Control and Expires).
  2. The presence of a validator (e.g., ETag or Last-Modified header).

How does this differ for files served from a network file-share? Across different browsers? Consider this JavaScript include:

<script type="text/javascript" src="\\SOMECOMPUTER\folder\file.js"></script>

Will browsers obey a meta tag such as this one when network files are involved?

<META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 31 Dec 2011 11:12:01 GMT">

I'm finding very little documentation on this topic.

like image 962
Elliot B. Avatar asked Dec 30 '12 04:12

Elliot B.


1 Answers

Edit: After actually doing some more tests, you can access the file that way with IE8, Firefox, and Google, assuming the proper permissions are setup, sorry for prior confusion.

Now its just back to the matter of will it cache java-script files (or any really), which is yes. So here's how you could fix that:

Using <meta> tags to turn off caching in all browsers? (This seemed to work fine for me so it appears that the browsers will listen to the meta tags for network files like this)

How to force IE to reload javascript? (This works just like how you would avoid caching ajax calls by appending the time to it as an unused variable)

like image 105
Andrew Hagner Avatar answered Sep 21 '22 04:09

Andrew Hagner