Forum Moderators: phranque

Message Too Old, No Replies

Specify nocache in robots.txt or .htaccess?

Kind of like default charset

         

MatthewHSE

4:59 pm on Apr 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know that adding "AddDefaultCharset ISO-8859-1" to my .htaccess file replaces using a meta-tag to declare the charset for the page. So, is there any similar method to replace the nocache meta tag, either with .htaccess or robots.txt?

I've searched around and so far the meta tag seems to be the only method; I'd rather use an "across the board" method if one exists.

Thanks,

Matthew

DaveAtIFG

7:33 pm on May 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm reasonably confident the meta tag is your only option.

robots.txt simply instructs spiders about what to crawl or not crawl. It does not include a "standard" to instruct spiders regarding caching.

"AddDefaultCharset ISO-8859-1" is a directive to modify your server headers. I haven't found a hint of a suggestion, or even a rumor ;) that indicates a SE spider will recognize a "no-cache tag" included in a server header.

Caution: There are numerous Apache directives to control page caching during the interaction between server and client. These directives are NOT even REMOTELY related to SE spiders and what SEs choose to cache. I have some very limited familiarity with some of those Apache directives, just enough to know I should leave them alone! :)

corz

8:26 pm on May 6, 2004 (gmt 0)

10+ Year Member


meta-tags are the way to go, yes.

obviously each page should have it's own meta-tags, but if there are certain tags that are common to all pages, you can use php (or something like that) to include only those tags. things like "author" and "publisher" and charset (UTF-8 dammit!) are prime candidates.

should save you some work (which I suspect is why you are asking)

;o)
(or

jdMorgan

9:13 pm on May 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See Apache mod_expires and mod_headers for info on how to add the cache-control and expiry headers to your site's resources at the server level or in .htaccess. I posted some example code with links here [webmasterworld.com].

Jim