473,473 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Prevent caching by ISP

Hi all

I'am ASP programmer and I have built a site that users can upload and
download files.All things store in a DB and everytime someone enters a
page,the application requery the Db and shows him data.
but there is aproblem:
all my pages caches before Client and i can not see fresh page.for
example if I did some activity on Monday on Wed. i Still see the old
page that was produced on Monday.I have put some header in BOth Html
And ASP files To prevent Caching:

ASP Header:
Response.AddHeader "Cache-Control","Private"
Response.AddHeader "Pragma", "no-cache"
Response.Expiresabsolute = Now() - 1
Response.CacheControl = "no-cache"
Response.CacheControl = "Private"
Response.expires= -1

Html Tags:
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Cache-Control" Content="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

it works fine on Client and browser will not cache but the ISP do.i
followed the headers and noticed that old pages come from ISP;so the
question is why
( Response.AddHeader "Cache-Control","Private" ) And
( <Meta http-equiv="Cache-Control" Content="no-cache"> ) don't work?
I Called the ISP Admin. but he says they refresh the pages very
quickly.
so where is the problem?

Thanks for attention
Behzad
Jul 23 '05 #1
10 9454
In comp.infosystems.www.authoring.html Behzad said:
all my pages caches before Client and i can not see fresh page.
you need to come to the realization that as soon as your goodies have
left your server you no longer have any control especially in regards to
cache and design accordingly.
it works fine on Client and browser will not cache


you're delusional

--
v o i c e s
Jul 23 '05 #2
Behzad wrote:
all my pages caches before Client and i can not see fresh page.for
example if I did some activity on Monday on Wed. i Still see the old
page that was produced on Monday.
That's suprising: most browsers are configured "out of the box" to
revalidate a page on each session.
I have put some header in BOth Html And ASP files To prevent Caching: Uh oh...
ASP Header:
Ok, this produces real http headers, so that's good.
Response.AddHeader "Cache-Control","Private"
Is the resource really private?
Response.AddHeader "Pragma", "no-cache"
This is an http 1.0 header to defeat all caching. Is such a dramatic
directive really necessarty?
Response.Expiresabsolute = Now() - 1
More questions: Must you expire the page in the past? This means that a
client must revalidate on each load, even if they're merely returning to
a page moments after misclicking.
Response.CacheControl = "no-cache"
Response.CacheControl = "Private"
Response.expires= -1
These repeat the headers you set, in a different way. Same questions remain.
Html Tags:
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Cache-Control" Content="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
These do exactly nothing. Get rid of them, and stop misleading yourself.
it works fine on Client and browser will not cache but the ISP do.


What do you mean? Is your isp running a proxy cache?

My advice: learn about http and caching, and work with caches instead of
against them.

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

--
Brian (remove "invalid" to email me)
http://www.tsmchughs.com/
Jul 23 '05 #3
On Sat, 9 Oct 2004, Brian wrote:
Behzad wrote:
I have put some header in BOth Html And ASP files To prevent Caching: Uh oh...


[...]
My advice: learn about http and caching, and work with caches instead of
against them.

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


All that Brian said; and definitely take some time with that tutorial.

One extra comment:

If your old document is -already- cached, then putting additional
headers into a new version of the page in the hope of defeating
cacheing is *not going to achieve a damned thing*. The client and/or
the cache which is holding the cached old copy is *not going to ask
for a fresh version until it's good and ready*, at which time it is
going to get your new copy anyway (with or without your mumbojumbo
anti-cache stuff).

What you need to do if you're in this situation, and clearing your
browser cache hasn't helped (so you guess that it's in some cacheing
proxy), is to force the cache to refresh *from the client end*.
There is absolutely *nothing* you can do from the *server* side that
can force any client or cache to go looking for a fresh copy, if it's
not yet ready to go asking the server anyway.

If it's a matter of a cached stylesheet, for example, then you'd need
to have your browser force a reload of the stylesheet. In Mozilla,
for example, you can do this by visiting the URL of the stylesheet
itself (not merely of the HTML page that calls it out), and then
command a forced-reload of the URL (ctrl/shift/R or equivalent).

(In the event that the intermediate cache doesn't honour that, then
it's not working to web specifications, i.e it's cacheing more
aggressively than it's really supposed to. So what makes you think
it'll be any less-aggressive in response to some anti-cacheing
headers? All that you're likely to achieve is to make the page much
less comfortable for /other/ readers to access.)
Jul 23 '05 #4
Alan J. Flavell wrote:
On Sat, 9 Oct 2004, Brian wrote:

Behzad wrote:

I have put some header in BOth Html And ASP files To prevent
Caching:


If your old document is -already- cached, then putting additional
headers into a new version of the page in the hope of defeating
cacheing is *not going to achieve a damned thing*.


I hadn't realized what the op was asking. I assumed he was talking about
how his page works in general, but on rereading it, he appears to be
talking about his own browser. So thanks for picking up on that.
If it's a matter of a cached stylesheet, for example, then you'd need
to have your browser force a reload of the stylesheet. In Mozilla,
for example, you can do this by visiting the URL of the stylesheet
itself (not merely of the HTML page that calls it out), and then
command a forced-reload of the URL (ctrl/shift/R or equivalent).


FYI: I've had good luck getting Mozilla to reload linked files -- css
and js -- by force-reloading the linking html page.

Mozilla seems pretty good in that regard, offering users a normal load
while surfing, a chance to reload (sending Cache-Control: max-age=0,
plus if-modified-since and if-none-match where applicable, so that a
conditional GET is possible) or force reload (Pragma: no-cache and
Cache-Control: no-cache, which requests a new copy from the origin
server). Add to that the LiveHTTPHeaders project, and you've got some
solid tools to test with.

--
Brian (remove "invalid" to email me)
http://www.tsmchughs.com/
Jul 23 '05 #5
Behzad (Bs********@yahoo.com) wrote:
: Hi all

: I'am ASP programmer and I have built a site that users can upload and
: download files.All things store in a DB and everytime someone enters a
: page,the application requery the Db and shows him data.
: but there is aproblem:
: all my pages caches before Client and i can not see fresh page.for
: example if I did some activity on Monday on Wed. i Still see the old
: page that was produced on Monday.I have put some header in BOth Html
: And ASP files To prevent Caching:

you can always send a different url when the page is changed.

http://my.server.com/my/page.html?sequence-no=123
^^^
change it each time

The url retrieves the same file each time no matter what the number is,
but each time a browser requests using a different number then the file it
gets cannot be a cached copy.

Note however that the user can end up with multiple versions cached, which
can be confusing if (for example) they use their back button to go to a
page. Also, the "base" page (http://my.server.com/my/page.html) which
would typically be used as a static link is not forced to update, though
that can be good if only some people need to ensure they have the most
recent version (such as someone who is editing the page).

Jul 23 '05 #6
On Sat, 9 Oct 2004, Brian wrote:
If your old document is -already- cached, then putting additional
headers into a new version of the page in the hope of defeating
cacheing is *not going to achieve a damned thing*.


I hadn't realized what the op was asking.


I wasn't sure one way or the other, but it's a misconception that I've
met several times before, so I thought it would do no harm to point it
out. No offence intended...
If it's a matter of a cached stylesheet, for example, then you'd
need to have your browser force a reload of the stylesheet. In
Mozilla, for example, you can do this by visiting the URL of the
stylesheet itself (not merely of the HTML page that calls it out),
and then command a forced-reload of the URL (ctrl/shift/R or
equivalent).


FYI: I've had good luck getting Mozilla to reload linked files -- css
and js -- by force-reloading the linking html page.


Oh, then I guess I was being too pessimistic - sorry.

all the best
Jul 23 '05 #7
On 8 Oct 2004 20:45:47 -0700, Bs********@yahoo.com (Behzad) wrote:
Hi all

I'am ASP programmer and I have built a site that users can upload and
download files.All things store in a DB and everytime someone enters a
page,the application requery the Db and shows him data.
but there is aproblem:
all my pages caches before Client and i can not see fresh page.for
example if I did some activity on Monday on Wed. i Still see the old
page that was produced on Monday.I have put some header in BOth Html
And ASP files To prevent Caching:

ASP Header:
Response.AddHeader "Cache-Control","Private"
Response.AddHeader "Pragma", "no-cache"
Response.Expiresabsolute = Now() - 1
Response.CacheControl = "no-cache"
Response.CacheControl = "Private"
Response.expires= -1

Html Tags:
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Cache-Control" Content="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

it works fine on Client and browser will not cache but the ISP do.i
followed the headers and noticed that old pages come from ISP;so the
question is why
( Response.AddHeader "Cache-Control","Private" ) And
( <Meta http-equiv="Cache-Control" Content="no-cache"> ) don't work?
I Called the ISP Admin. but he says they refresh the pages very
quickly.
so where is the problem?

Thanks for attention


I have just had a CSS caching problem, on a simple HTML based non-dynamic
website. I just could not get my stylesheets to refresh, even if I addressed
them directly, or so I thought.

So, for instance, (simplified) I had page mysite.com/mypage.html with stylesheet
mystyle.css in the same folder. Even if I addressed the stylesheet directly as
mysite.com/mystyles.css, and did a forced reload, I kept on getting the old
stylesheet. I deleted the damn thing, and *still* got it.

However, I suddenly realised that I was misrepresenting the "facts" to myself.

My files were actually at mysubdomain.somewebs.com and mysite.com was actually
a *redirected* address, using frames, so although I was displaying the content
of the css file, if I looked at "page source" I found :-

<frameset rows="100%,*" border="0" framespacing="0" frameborder="0">
<frame src="http://mysubdomain.somewebs.com/mystyles.css">
</frameset>

Problem resolved - when I thought I was reloading the css file, I was actually
merely reloading the frameset.

So - another thing to think about is the *true* path to your content, rather
than your (mis)conception of it :-)

(Posted this in such detail for posterity and the archive)
Jim

Jul 23 '05 #8
Hi all.

I realized .If in address bar i type
http://mydomain.com

then the browser brings me a non-cached page but if i type
http://www.mydomain.com

then it brings the old one.Any suggestion on this?

Thnaks for ur attention

Behzad
Jul 23 '05 #9
Hi again.
my site acts like an Email service.Each time u visit the site u see
the fresh page;but in my site when i enter the username and
password,after login it shows me older pages but for example
mail.yahoo.com every time shows new pages.what's wrong with me?is
there anything that i have forgotten?

Thanks.
Behzad
Jul 23 '05 #10
In article <ae**************************@posting.google.com >, Bsedigh_79
@yahoo.com enlightened us with...
Hi again.
my site acts like an Email service.Each time u visit the site u see
the fresh page;but in my site when i enter the username and
password,after login it shows me older pages but for example
mail.yahoo.com every time shows new pages.what's wrong with me?is
there anything that i have forgotten?


1. Other servers along the way may be caching the page, including your ISP's
server and any proxy servers you may be using.
2. Check your browser settings.
3. Are you expiring the pages? You should. It's a header.

That's all I can think of...

--
--
~kaeli~
Profanity: the single language in which all programmers are
expert.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #11

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

Similar topics

3
by: Santhi | last post by:
Hi, I wish to avoid caching asp pages at the user end . Currently I have declared Response.Expires=0 at the top of my asp page. I have also used the following meta tags to prevent client side...
14
by: Ludwig77 | last post by:
I read that there are some tags that can be entered in a web page's meta tags in order to prevent web bot searching and indexing of the web page for search engines. What is the tagging that I...
5
by: R. Ian Lee | last post by:
I have an ASP.NET page that spawns a popup window using javascript's window.open. This works fine. It pops up, you enter some data, press save and everything saves as it should. But, if you...
2
by: gu4y | last post by:
Hello All, Is there anyway to globally prevent client browser caching in ASP.NET? Otherwise, I will have to put: Response.Cache.SetCacheability(HttpCacheability.NoCache); in every page's...
0
by: Frankie | last post by:
When I want to prevent a page from being cached, I have been using the following directive: <%@ OutputCache Location="none" %> I have also seen a few other methods recommended to prevent page...
1
by: Ronald S. Cook | last post by:
I have an ASPX page wherein I receive an ID of a file to play. http://localhost/fwi/mediaplayer.aspx?id=3 When I go to a browser and type in the above, it works fine. But when I change the 3...
9
by: =?Utf-8?B?SmVmZiBCZWVt?= | last post by:
I'm working on a litigation web app where users will review images of case documents. One of the requirements is that we either prevent the images from being cached on the clients machine (in temp...
7
by: mark4asp | last post by:
How can I prevent Caching of JavaScript and CSS files ONLY when I deploy a new application? I only want to force a refresh the first time the client uses the new build. For instance, I'm told I...
0
by: helveticus | last post by:
I have a master/details configuration that includes multiple user controls. The details page is configured to cache data via VaryByCustom. This works fine. One of the user controls contains an...
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.