Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Stop JS caching
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Stop JS caching

 Post Reply Post Reply
Author
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Topic: Stop JS caching
    Posted: 22 May 2005 at 6:45pm
On my Fire fox extension I have the line:

<script type="application/x-javascript" src="http://www.c4sms.com/fireFox/getaddresses.asp" />

Basically if you are logged in it lists your addresses as a javascript array so it can be manipulated and used in the rest of the extensions code.

However, FireFox seems to cache it.  This is not a script issue, it works fine before the cache, then whatever you do it presents the same values.

I put the lines:

    Response.Expires = 60
    Response.Expiresabsolute = Now() - 1
    Response.AddHeader "pragma","no-cache"
    Response.AddHeader "cache-control","private"
    Response.CacheControl = "no-cache"

In the JS file (as it is an ASP file), but Firefox still seems to cache it.

Any ideas what I can do?  It's pretty important this is not cached.
Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 22 May 2005 at 6:50pm
Ah, found the answer in IRC, I should of known this one.

Just put a querystring at the end with date and time

EDIT:

Still some problems if someone could help.  It doesn't like putting variables in script definition lines:

<script language="Javascript">
var currentTime = new Date()
var cacheControlVar = currentTime.getTime();

var scriptInclude = ('<script type="application/x-javascript" src="http://www.c4sms.com/fireFox/getaddresses.asp?cachecontrol='+ cacheControlVar +'" />');

document.write(scriptInclude + "<BR><BR><BR>" + requestStatus);

</script>

Request status is a variable that should be pulled in from the included script.  Im basically trying to print a line that includes a JS with a variable parameter.


Edited by Gullanian - 22 May 2005 at 7:02pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.