Forum Moderators: open

Message Too Old, No Replies

META HTTP-EQUIV="Pragma" CONTENT="no-cache"

Why not use it everywhere?

         

ssih

10:44 pm on May 31, 2002 (gmt 0)



I recently did an update for a client of mine. After I sent him an email telling him that the update was done, he called me and told me that he just brought up the page and the change wasn't there. I told him to hit the refresh button, which showed him that the change WAS there, but he felt that his regular visitors to the site aren't going to know that there is an update and won't know to hit the refresh button (he had a point).

I expounded on the virtues of cache, but he was pretty adament about the situation. So I told him that I could alter the code so that it wouldn't be cached in people's browser, by inserting the meta tags

META HTTP-EQUIV="Expires" CONTENT="0"
META HTTP-EQUIV="Pragma" CONTENT="no-cache"

in the head section. He liked this idea and wants me to insert these in all of the pages throughout his site.

Is there any good reason not to do this?

lorax

11:06 pm on May 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If your content doesn't change often you could avoid this tag and save your server from the wear and tear. No cache just tells the browser not to use cached pages and therefore it must call the web server for the page again - regardless of whether it viewed it 2 days ago or 2 minutes ago. If the page hasn't changed why would you want to? Let the user's computer do the work.

TRACEYR

11:28 pm on May 31, 2002 (gmt 0)

10+ Year Member



I have been playing with this idea all week but slightly different.

I want it to use the cache copy...rather than going to server each time....

So i coded in the following

TEST.ASP
<%Response.AddHeader "Cache-Control", "public"%>
<%Response.AddHeader "pragma", "public"%>

<%Response.AddHeader "Expires=15"%>

NOW all my pages at moment are HTML pages

Do i have to change all these to ASP FILES.

richlowe

5:25 am on Jun 1, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I tend to do all of this with HTTP headers at the server. In IIS (and I'm sure there is something similar in Apache) you simply set the nocache and expire on the page or folder or even site and IIS then takes care of setting the headers appropriately.

The meta tags are useful, but the HTTP is better because proxy servers and such do NOT parse HTML and so never get the meta tags. HTTP headers are always parsed if the browser understands HTTP 1.1.

Richard Lowe

Son_House

6:19 am on Jun 1, 2002 (gmt 0)

10+ Year Member



Is there any good reason not to do this?

Well from a surfers perspective it can really slow things down. I still use 56k to surf and when sites do that I find it very irritating because it takes so long to reload a page that I did not want reloaded. I have even stopped going to some sites that do that.

keyplyr

6:45 am on Jun 1, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>...it can really slow things down

I have not found that to be the case. I use the no-cache tag on each of over a hundred pages and my server status codes report very few partial page loads.

Of course I keep my pages under 40k (w/images) and do not use SSI that does tend to slow page loads.

BTW, it doesn't reload a page.

mack

8:41 am on Jun 1, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I would only use the "no cache" code on my homepage that way users get to see th enew page every time they visit. internal pages dont tend to change so often.

keyplyr

9:30 am on Jun 1, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I almost forgot to mention why I use the tag on all pages.

I do not use cookies and rely upon analyzed log files 100% for visitor data. Eliminating browser caching is a great help in getting a more valid count of page loads and other information. Of course this tag does not affect cache bins of IPs and proxies.

Brett_Tabke

10:35 am on Jun 1, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I think some se's decrease rankings on pages with the no-cache tag.

mack

11:47 am on Jun 1, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Brett,

why do they reduce ranking for these pages...???

brotherhood of LAN

11:50 am on Jun 1, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Mack,

My guess would be because it means those fickle domain names that magically turn into po** is one reason. Cache keeps a good tab on what direction sites are heading in. Without the cache, we have to take it at face value. I'm sure there are reasons with grounds somewhere :)

dcheney

11:53 am on Jun 1, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Howdy,
I only use no-cache on a few pages like "Latest Changes" and similar.
For users on slower connections (like me!) caching is the only thing that makes many sites usable at all.

-David

ssih

12:17 pm on Jun 1, 2002 (gmt 0)



I think some se's decrease rankings on pages with the no-cache tag.

That seems a little extreme. And it would probably be enough to change my client's mind about this, since the initial change was on his home page. He's got a little "What's New" section to point people to new/updated pages.

lorax

1:53 pm on Jun 1, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



keyplyr,

BTW, it doesn't reload a page.

My understanding is that if no cache is set the browser will request the page - or are you suggesting it does a CRC or datetime check to determine if it needs to request the page again?

PsychoTekk

2:46 pm on Jun 1, 2002 (gmt 0)

10+ Year Member



there are so many options [psychotekk.de] that can be set,
either by using the meta-tag or cgi scripts for example
(consider the point richlowe meantioned, cacheproxies will not parse the
body of a document and therefore not see the meta-tags)

i use the no-cache meta-tag on nearly all my html docs because
i'm tired of letting a user view content that is outdated.

cacheproxies can request documents from my server using the
HTTP_IF_MODIFIED_SINCE variable:
the whole document is only resent to the cacheserver if it has changed
since it was last requested

btw, if one hits the refresh button this same IF_MODIFIED_SINCE variable
is used to do the request

keyplyr

4:45 pm on Jun 1, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>I think some se's decrease rankings on pages with the no-cache tag.

no, I see no evidence of that. All I see are more accurate logs and users getting updated pages.

fashezee

8:45 pm on Jun 2, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<#9> "I think some se's decrease rankings on pages with the no-cache tag."

Wouldn't "no-cache" result in more hits on your site thus improve your ranking; assuming the users ISP does not use proxy servers?