473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

caching

ABC
I have an html page that has a javascript file included as well, with
the src == my.js. The problem is my page gets cached, which I want
and my js file gets cached, which I don't want. Is there a way to
just refresh the javacript file?

thks

ABC
Jul 20 '05 #1
2 3052
If you just want to refresh the js during development and test, control-f5
seems to work in IE

If you want it never to be cached in the production environment, you'll need
to get the web server to generate a no-cache HTTP directive. you'll need to
refer to the documentation for your web server on that one.

Andy
"ABC" <bc*******@imagictv.com> wrote in message
news:3f****************@allnews.nbnet.nb.ca...
I have an html page that has a javascript file included as well, with
the src == my.js. The problem is my page gets cached, which I want
and my js file gets cached, which I don't want. Is there a way to
just refresh the javacript file?

thks

ABC

Jul 20 '05 #2
Andy Fish wrote:
If you just want to refresh the js during development and test, control-f5
seems to work in IE

If you want it never to be cached in the production environment, you'll need
to get the web server to generate a no-cache HTTP directive. you'll need to
refer to the documentation for your web server on that one.

Andy

"ABC" <bc*******@imagictv.com> wrote in message
news:3f****************@allnews.nbnet.nb.ca...
I have an html page that has a javascript file included as well, with
the src == my.js. The problem is my page gets cached, which I want
and my js file gets cached, which I don't want. Is there a way to
just refresh the javacript file?

thks

ABC


One of the ways to deal with this is something like:

<script type="text/javascript" src="my.js?version=200308070934"></script>

When you change my.js, change the HTML containing the reference to it and upload
them both. This can be bothersome if you use the script in many HTML files,
there are two other options to this:

1) server-side includes: put the <script ...> tag in another file and use SSI to
include that file on each page you want the script to appear on. Then you change
the "version" value above in a single place and it will take effect on all pages

2) client-side "includes": put

document.write('<script type="text/javascript"
src="my.js?version=200308070934"><\/script>');

in /another/ script file ("myWrapper.js" or something), then include that one on
your pages. If you never want your file cached you could use:

document.write('<script type="text/javascript" src="my.js?timestamp=' +
(new Date()).getTime() +
'"><\/script>');

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: olle | last post by:
Hi folks. I learning asp.net and compare it with traditional asp and Access-developing. The issue is this one: 1/I have this Ms Acceess adp-project application that works fine on my Ms Sql...
1
by: moko | last post by:
I want to know whether 'dataset caching' is at the client end , or the server ? Similarly is an aspx page caching at the server or client ? Are there any 'gotchas' with caching ?
0
by: Troy Simpson | last post by:
Hi, I have a website which is made up of dynamic pages. Each page that's loaded has some code which looks at which template to load amongst other things, which causes the page to take a little...
3
by: Janaka | last post by:
Hi All, I'm having a problem with Page Output caching on a page that contains a DataGrid. Basically the page pulls up some data for sales information from the DB. Some of this has to be...
1
by: Leo Muller | last post by:
I am impressed by the caching performance of .NET. However, there is one major obstacle that I haven't managed to solve yet. What I want to do is the following: I have a normal site, and a...
3
by: DC | last post by:
Hi, (ASP.Net 1.1) is it possible to (programmatically and globally) deactivate page fragment caching? We have only two scenarios, development stage where we want caching off and testing where we...
5
by: Raj | last post by:
What is the purpose of file system caching while creating a tablespace? Memory on the test server gets used up pretty quickly after a user executes a complex query(database is already activated),...
2
by: George1776 | last post by:
All, I've recently upgraded our production ASP.NET/C# application from framework 1.1 to 2.0. Since then I've been plagued by out-of-memory errors and problems with the cache object (which may...
0
by: jason | last post by:
hi experts, support.microsoft.com/kb/917072 and http://msdn.microsoft.com/msdnmag/issues/06/07/WebAppFollies/ As pointed out in these articles, users might get session variables belong to...
4
by: Hermann | last post by:
My site is a bit slow showing the main page so I thought caching query result in PHP will improve performace. Then I read MySQL documentation and saw that MySQL does have a caching feature. So......
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.