clear the cache at startup
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 16 Mar 2006 15:25:40 +0000 (15:25 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 16 Mar 2006 15:25:40 +0000 (15:25 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3371 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/main/main.js

index 79fe166..6f85618 100644 (file)
@@ -14,9 +14,22 @@ function grant_perms(url) {
 
 }
 
+function clear_the_cache() {
+       try {
+               var cacheClass          = Components.classes["@mozilla.org/network/cache-service;1"];
+               var cacheService        = cacheClass.getService(Components.interfaces.nsICacheService);
+               cacheService.evictEntries(Components.interfaces.nsICache.STORE_ON_DISK);
+               cacheService.evictEntries(Components.interfaces.nsICache.STORE_IN_MEMORY);
+       } catch(E) {
+               dump(E+'\n');alert(E);
+       }
+}
+
 function main_init() {
        dump('entering main_init()\n');
        try {
+               clear_the_cache();
+
                if (typeof JSAN == 'undefined') {
                        throw(
                                "The JSAN library object is missing."