The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
Headers to cache JavaScript
I have a member I have to suspend from time to time and during the suspension he tries registering several times a day. My plan is to cache some JavaScript on his computer to identify him and abort his registration attempts.
My other admin suggested testing for a JS variable and if it has no value use AJAX to call a PHP file whose output is treated as a JS file that will be cached. Using the headers he suggested, I created a file, cache.php, to test caching: PHP Code:
Code:
<script> if(typeof testVar == 'undefined') { var getCache = new vB_AJAX_Handler(true); getCache.onreadystatechange(function() { alert(getCache.handler.responseText); }); getCache.send('cache.php'); } else { alert('t = ' + testVar); } </script> It doesn't cache. Do I have a problem with my headers or is there some feature of vBulletin that prevents caching? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|