-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
30 lines (22 loc) · 890 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
# 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