meta tag newbie question
Hi, I'm hoping that someone with real expertise can help me.
I have a site that will be updated daily and to make sure that the new info is available immediately to visitors I want to use the correct meta tags.
So, I researched sites, looked at source codes, and came to one conclusion---everyone is doing things differently!
I have considered:
meta name "revisit"
meta name "expires"
meta http-equiv="pragma" content="no cache"
meta http-equiv="cache-control" content="no-cache"
I just want my visitors to get the updated info asap. Please Help
andy206uk posted this at 08:39 — 28th June 2004.
He has: 1,758 posts
Joined: Jul 2002
I recently discovered something that might be of use for you.
We were working on an online CSS editor for a client and we found that the browser was caching the stylesheet, big problem because the page needed to be updated when the user clicked save.
What we did to get round it was simple:
<link rel="stylesheet" type="text/css" href="stylesheet.css?<?= time() ?>">
Because the url of the stylesheet called was different each time (because we appended a query string with a timestamp on it), they always got a fresh copy!
CSS doesnt have the ability to parse query strings, so it didnt make a difference to the output either!.
Use the same thing on your site and your problem is solved. (if you don't have php, use javascript to generate the timestamp instead).
Obviously... search engines that don't like query strings or javascript links may have a problem with this, so i don't reccomend it if you need the page to be really search engine friendly.
Andy
island597 posted this at 17:07 — 30th June 2004.
They have: 18 posts
Joined: Jun 2003
Thanks for your reply...but I have only basic html abd css knowledge, and your suggestion is a little over my head. I wonder if there is a script that I could cut\paste into my source code....I am hosted on an apache server (if that helps). But thanks alot anyway.
m3rajk posted this at 20:18 — 30th June 2004.
They have: 461 posts
Joined: Jul 2003
i'd suggest learning php.
however there is something else... metas that stop caching....
one sec. i have to look this up since i usephp functions now since it's easier
POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.
m3rajk posted this at 20:29 — 30th June 2004.
They have: 461 posts
Joined: Jul 2003
1: set it to expire prior to having been sent.
2: i'm not sure how to bring this into meta, but this is a copy of the headers functions i have that stop caching
header("Expires: Sat, 24 Feb 1979 20:00:00 GMT");
header("cache-control: no-store,no-cache,must-revalidate");
header("cache-control: post-check=0,pre-check=0", false);
header("Pragma: no-cache");
3:
first one is item 1
the next three are to stop caching
POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.
andy206uk posted this at 10:47 — 1st July 2004.
He has: 1,758 posts
Joined: Jul 2002
Based on the fact the pragma no-chache one looks like this in meta format:
You could assume the rest would be:
Whatcha reckon?
island597 posted this at 17:12 — 2nd July 2004.
They have: 18 posts
Joined: Jun 2003
Thanks for all of the great suggestions. I used them all - well, I haven't learned php , but I am using the other meta tags and it seems to be working.
m3rajk posted this at 20:11 — 2nd July 2004.
They have: 461 posts
Joined: Jul 2003
no problem.
like i said, easiest thing to do would be to learn php.
the issue with css files and why that would cache (possible exception is if you tell your browser to check each time) is the w3c standards say that you download them once when you viist the site and keep it for that site until expired or cache cant keep it. this speeds up page loading. obviously there's some issues
it looks like you're trying to use pages generated on pageload. the best way, imho, is php.
asp is good but proprietary and slow to fix bugs in it.
POSIX. because a stable os that doesn't have memory leaks and isn't buggy is always good.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.