Skip to content
Browser cache invalidation with Javascript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README
cache_invalidation.js
querystring.js

README

#
# Author: Rogério Carvalho Schneider <stockrt@gmail.com>
# URL:    http://stockrt.github.com
#

Invalidates browser's cache for a given page based on the last refresh.

Usage:
- Include in the HEAD of your page and set the TTL
    <html>

    <head>
     <script src="http://your_site/javascripts/querystring.js" type="text/javascript"></script>
     <script src="http://your_site/javascripts/cache_invalidation.js" type="text/javascript"></script>
    </head>

    <body>
    </body>

    </html>

- And set the TTL you want into the cache_invalidation.js file:
    // TTL: set your cache threshold here
    var ttl = 300;  // seconds

The querystring.js component I got from Adam Vandenberg:
http://adamv.com/dev/javascript/querystring

See also for a complete explanation on how it works and why:
http://stockrt.github.com/p/browser-cache-invalidation-with-javascript-and-querystring
You can’t perform that action at this time.