Client caching

P

Pål Johansen

Is it possible to cache portions of a page client side.
I have som include pages that I would like to store at the clients cache.
 
K

Kevin Spencer

You can cache anything that is normally cached on the client, such as images
an other binaries, .js files, and cookies.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.
 
P

Pål Johansen

In a sense, you don't.
True, and thats the problem.
It wont cache clock.js either, because after the server prosess that file it
will just be a part of the whole page.(clock.js is server side include)
So if one letter changed on the page the client will download all of the
page over again.(except the cached images) Even though clock.js is
unchanged.


But it wont cache
 
P

Pål Johansen

Thanx alot. Didn't know that.

Kevin Spencer said:
file

If you use a server-side include that creates a script tag like the
following, only a change in the "clock.js" file would cause the browser to
re-download it:

<script type="text/javascript" src="clock.js"></script>

The reason is that the reference to the.js file is not changed when the page
it is in changes. It works just like an image tag. Putting an image tag into
a page that changes doesn't cause the browser to re-download the image with
every request. It only re-downloads the page.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.


file
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top