Skip to content

stockrt/cache_invalidation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

#
# 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

About

Browser cache invalidation with Javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published