Prev: Determining Browser Vendor, Version, and Operating System WithJavaScript
Next: XSLT v. Javascript
From: Thomas 'PointedEars' Lahn on 4 Jun 2010 09:56 SleeplessAndy wrote: > We have a site with some .js files that due to size/wan speed we want > to stay cached. Why could they be sticking around for about 10 > different document loads, accessing the file, browsing away to other > pages, then back to similar docs using the file again, thenn suddenly > it gets deleted. The IE cache is set for testing to 5mb, and the file > sticks around, even though the cache continually goes up to this limit > and above, and other files are replaced. Then suddenly, a page load > will cause the large .js file to be removed, even though the expiry is > 30 days in the future. > > I don't understand. Any help gratefully received! The problem might have to do with the way you load the ".js files". Not understanding how HTTP caching works has led many people to believe that using a variant query-part when referring to resources would be a proper solution, e.g.: document.write('<script type="text/javascript" src="foo.js?' + (+new Date()) + '"><\/script>'); Of course, this means that a HTTP client regards every such resource a single entity, which fills HTTP caches much faster than if the recommended method, cache control¹, would have been used (for example, it would take only 10 reloads of a cached HTML document including 5 script resources of 100 kB size each until a cache of 5 MB size was full²). As a result, other, especially larger resources need to be removed from the cache earlier if the policy is that the cache size should not exceed a certain limit. However, I recommend to set the IE cache size to something between 20 and 100 "MB". (42 works for me, of course ;-)) That said, in my experience IE's caching mechanism, at least in IE 6.0 and 7.0, appeared to be borken in several places. It is difficult to see why you would post this problem to a newsgroup dealing with Internet Information Server/Services, and another one dealing with ECMAScript-based script programming, instead of to one dealing specifically with Microsoft Internet Explorer. You should also be aware that Microsoft has announced that beginning in June 2010, they would begin closing their newsgroups, so it might not be the best idea to use the microsoft.* hierarchy anymore.³ <http://www.catb.org/~esr/faqs/smart-questions.html> F'up2 cljs PointedEars ___________ ¹ <http://www.mnot.net/cache_docs/> ² For simplicity, I am using SI units here (I do not know what IE uses): 1 MB = 1000 kB = 1'000'000 bytes (but 1 MiB = 1024 KiB = 1'048'576 bytes) ³ <http://www.microsoft.com/communities/newsgroups/default.mspx> -- Anyone who slaps a 'this page is best viewed with Browser X' label on a Web page appears to be yearning for the bad old days, before the Web, when you had very little chance of reading a document written on another computer, another word processor, or another network. -- Tim Berners-Lee
From: Dr J R Stockton on 5 Jun 2010 15:05 In comp.lang.javascript message <1307384.WGnKmheAe9(a)PointedEars.de>, Fri, 4 Jun 2010 15:56:19, Thomas 'PointedEars' Lahn <PointedEars(a)web.de> posted: > >You should also be aware that Microsoft has announced that beginning in June >2010, they would begin closing their newsgroups, so it might not be the best >idea to use the microsoft.* hierarchy anymore.� Microsoft will be removing the groups from their servers and perhaps issuing 'rmgroup' messages. News server administrators will honour or disregard those messages as they see fit. I doubt, for example, whether Google will do so; they compete with Microsoft. It should raise the average intelligence in those groups noticeably. The intelligent move, therefore, is to continue to use those groups while being aware that the Microsoft adulators will no longer be present. -- (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05. Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms PAS EXE etc : <URL:http://www.merlyn.demon.co.uk/programs/> - see 00index.htm Dates - miscdate.htm estrdate.htm js-dates.htm pas-time.htm critdate.htm etc.
First
|
Prev
|
Pages: 1 2 Prev: Determining Browser Vendor, Version, and Operating System WithJavaScript Next: XSLT v. Javascript |