External javascript being cached?

134 views
Skip to first unread message

mumpster99

unread,
Oct 19, 2009, 4:25:48 PM10/19/09
to intersystems.public.cache
Hi,

This may seem like simple question to some but it's got me
stumped...

I have a CSP page that loads an external javascript document. And
it works fine the first time I run my CSP page. However if I make
changes to the script code and re-run my CSP it uses the previous
verison of the script. It's almost like the script is being cached on
the server between invocations of my page.

So do the scripts get cached on the server somewhere? And how do I
stop this? Or is there something else I'm completely missing here?

Oh yes, I'm running on Apache with Cache 2009.1 so it not the built in
web server from Cache.

Thanks,
Gary Marston

Jason Warner

unread,
Oct 19, 2009, 4:32:23 PM10/19/09
to intersystems...@googlegroups.com
Gary,

It may not be Cache. Have you cleared your cache on the browser you are
testing with? When I have external javascript files I have noticed my
two development browsers (Firefox and Chrome) require me to actually hit
the refresh button to pick up new javascript changes.

Jason

Tony

unread,
Oct 20, 2009, 6:01:38 AM10/20/09
to intersystems.public.cache
Hello Gary - you find the following link of some help. /Tony

<http://en.wikipedia.org/wiki/Bypass_your_cache>

Internet Explorer - To reload a page and bypass the cache:
either: Hold down the Ctrl key and then press F5.
or: Hold down the Ctrl key and click the Refresh button on the start
bar.

Mozilla family - To reload a page and bypass the cache:
either: Hold down both the Ctrl and Shift keys and then press R.
(alternatively, hold down the Ctrl key and then press F5.)
On a Mac, use the Command key instead of Ctrl.
or: Hold down the Shift key and click the Reload button on the
navigation toolbar.

Sukesh

unread,
Oct 21, 2009, 4:33:07 AM10/21/09
to intersystems.public.cache
Gary

Try by using this meta tag in your csp page(s), it mayslve your
problem

<CSP:PAGE EXPIRES="-1" SUPER="%CSP.Page">

Regards
Sukesh Hoogan
Bombay, India
- Enterprise Resource Planning
- Business Intelligence
- Financial Accounting
- Offshore Development

OldMster

unread,
Oct 21, 2009, 12:41:39 PM10/21/09
to intersystems.public.cache
Sukesh,
That would help if it was the CSP page that was the problem, but it is
the included javascript file that is being cached. And even then, I
found browser support for the 'expires' and 'no-cache' pragmas to be
inconsistent at best.
Mark

kevin furze

unread,
Oct 21, 2009, 5:15:02 PM10/21/09
to intersystems.public.cache
Sukesh,
if I've understood the question correctly, you are trying to force the
customers cache to be updated whenever YOU want to change the contents
of the javascript file but retain the filename.


if so, you may be able to use htaccess to help you. Its a tip I found
on the web some time ago, but is v useful - in this example, all
javascript files are held in /zap/j/*.js and css files are held in /
zap/c/*.css

"I use it on every site I work on. It allows me to update my
javascript and css files in my visitors cache’s simply by naming them
differently in the html, on the server they stay the same name. This
rewrites all files for /zap/j/anything-anynumber.js to /zap/j/
anything.js and /zap/c/anything-anynumber.css to /zap/c/anything.css"

the line in the htaccess file reads as follows:

RewriteRule ^zap/(j|c)/([a-z]+)-([0-9]+)\.(js|css)$ /zap/
$1/$2.$4 [L]

I hope I've interpreted you question correctly.

kev

Benjamin Spead

unread,
Oct 19, 2009, 4:28:55 PM10/19/09
to intersystems...@googlegroups.com
The CSPGateway can be set to cache static files for performance reasons. I don't know off the top of my head where you chance that, but I am guessing that is the culprit.

Thomas Springer

unread,
Oct 22, 2009, 6:46:41 PM10/22/09
to intersystems...@googlegroups.com
> The CSPGateway can be set to cache static files for performance reasons.
> I don't know off the top of my head where you change that, but I am
guessing that is the culprit.

This can be done by editing the CSP-Application settings, it's the
"ServeFiles" property that controls caching by the CSPGateway.

Caching through the CSPGateway is new w/ Caché 2009.1


Thomas

Sukesh

unread,
Oct 25, 2009, 12:53:00 AM10/25/09
to intersystems.public.cache
Perhaps this would be of help

http://www.mnot.net/cache_docs/

http://forums.whirlpool.net.au/forum-replies-archive.cfm/927740.html

Regards
Sukesh Hoogan
Bombay, India
- Enterprise Resource Planning
- Business Intelligence
- Financial Accounting
- Offshore Development


On Oct 20, 1:25 am, mumpster99 <glmars...@cvty.com> wrote:

nalbant

unread,
Oct 20, 2009, 4:47:08 AM10/20/09
to intersystems...@googlegroups.com
remove browser accelerator add-ons from your development environment.


"mumpster99" <glma...@cvty.com>, haber iletisinde sunlari
yazdi:cb09ea6e-56dd-46f9...@l33g2000vbi.googlegroups.com...

Enrico Parisi

unread,
Oct 26, 2009, 8:36:37 PM10/26/09
to intersystems...@googlegroups.com
Try clearing the CSP Gateway cache, from management portal:
Configuration - CSP Gateway Management - System Status - Clear cache button

HTH
Enrico
Reply all
Reply to author
Forward
0 new messages