Permalink
Browse files

IC cache busting for captcha refresh.

  • Loading branch information...
1 parent 5a1ba34 commit 4d5a1b20270d38f2d1883ef8461428c30ad43a77 @msjohns1 msjohns1 committed Dec 11, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 eg/captcha_refresh.cfg
View
@@ -44,14 +44,16 @@ sub {
<script>
function $js_func_name() {
var ajax = new XMLHttpRequest();
+ // Extra cache-busting insurance if header doesn't work
+ var cb = new Date().getTime();
ajax.onreadystatechange = function() {
if (ajax.readyState == 4 && ajax.status == 200) {
document.getElementById('$img_id').src = ajax.responseText;
}
}
- ajax.open('GET','$url',true);
+ ajax.open('GET','$url?cb='+cb,true);
ajax.send();
return;
}
@@ -73,6 +75,10 @@ sub {
$opt{name_only} = 1;
my $doc = Vend::Document->new;
+
+ # Bust that cache for IE
+ $doc->header('Cache-Control: no-cache');
+
$doc->hot(1);
$doc->write($::Tag->captcha(\%opt));
return 0;

0 comments on commit 4d5a1b2

Please sign in to comment.