View previous topic - View next topic |
Author |
Message |
Terry Spectral Form
Joined: 16 Jun 2002 Posts: 798 Location: Dublin, Ireland
|
Posted: Tue Jul 26, 2005 10:48 am Post subject: Quick HTML question |
[quote] |
|
I've noticed when I check my website on my work computer and my college computer that it doesn't update - you have to manually hit the refresh button before you see the new information. I'm not sure why this happens, but I'd love to know if there's anything I can do about it. So far, all I've found with websearches are ASP tutorials for VBScript. There has to be a simpler way to do this...
Has anyone got any ideas? I'm hoping there's something simple I can do like a html tag that tells the browser not to cache. _________________ http://www.distractionware.com
|
|
Back to top |
|
|
Adam Mage
Joined: 30 Dec 2002 Posts: 416 Location: Australia
|
Posted: Tue Jul 26, 2005 1:17 pm Post subject: |
[quote] |
|
You could give this a shot.
Code: | <META HTTP-EQUIV="expires" CONTENT="0"> |
If your really desperate you could throw a random number on the end of the page name ie "index.html?random=989" _________________ https://numbatlogic.com
|
|
Back to top |
|
|
Verious Mage
Joined: 06 Jan 2004 Posts: 409 Location: Online
|
Posted: Tue Jul 26, 2005 1:56 pm Post subject: |
[quote] |
|
Add the following HTML to the <HEAD> </HEAD> section of the page.
Code: | <META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="expires" CONTENT="Fri 8 Jun 1979 08:00:00 EST">
|
Any date well in the past will work for the expires tag.
|
|
Back to top |
|
|
Terry Spectral Form
Joined: 16 Jun 2002 Posts: 798 Location: Dublin, Ireland
|
Posted: Tue Jul 26, 2005 2:09 pm Post subject: |
[quote] |
|
I've tried with Adam's tag, with Verious's tag, and with both, but I'm still getting the same problem. For trying though, you both rock. Decisively.
All other ideas are welcome... _________________ http://www.distractionware.com
|
|
Back to top |
|
|
Nephilim Mage
Joined: 20 Jun 2002 Posts: 414
|
Posted: Tue Jul 26, 2005 7:20 pm Post subject: |
[quote] |
|
Chaotic Harmony wrote: | All other ideas are welcome... |
Some other things to look at:
There are multiple places your pages could be being cached. The obvious place is your browser, but others could be on the server and somewhere in between, such as your ISP or a proxy server. If you rule out browser caching, you can look there.
Be sure that your browser cache settings are not set to only update "once per session." Even if you set your cache settings to expire immediately in the document, it still won't obey that if you have told the browser not to.
Depending on how you're managing your pages, you could be seeing a lag in page updating. For instance, a CMS might only publish out to a production server once every five minutes or something, or it might have a caching mechanism of its own.
If all else fails, switch browsers and see if the problem goes away. _________________ Visit the Sacraments web site to play the game and read articles about its development.
|
|
Back to top |
|
|
Terry Spectral Form
Joined: 16 Jun 2002 Posts: 798 Location: Dublin, Ireland
|
Posted: Tue Jul 26, 2005 9:09 pm Post subject: |
[quote] |
|
Ah! Got it - here's the solution for anyone who cares:
I decided to try a different tactic, and see if there's anything I could do with my php settings - and this came up on the first search:
Code: | <Files *>
Header set Cache-Control: "private, pre-check=0, post-check=0, max-age=0"
Header set Expires: 0
Header set Pragma: no-cache
</Files> |
Adding that to the .htaccess file works perfectly. Thanks for the suggestions all the same. _________________ http://www.distractionware.com
|
|
Back to top |
|
|
Nephilim Mage
Joined: 20 Jun 2002 Posts: 414
|
Posted: Wed Jul 27, 2005 5:19 am Post subject: |
[quote] |
|
Well, it looks like that will preclude any and all caching. That will fix your problem, but will probably increase your server load and bandwidth costs.
Ideally, you'd identify which files need to have that zero cache length (say, all .php files?), and restrict your no-cache .htaccess settings to those files. That way, the mainly static content can be cached, saving bandwidth.
In any case, glad you found a solution! _________________ Visit the Sacraments web site to play the game and read articles about its development.
|
|
Back to top |
|
|
Terry Spectral Form
Joined: 16 Jun 2002 Posts: 798 Location: Dublin, Ireland
|
Posted: Wed Jul 27, 2005 7:13 am Post subject: |
[quote] |
|
That sounds like a very good idea. I wonder if it's a simple as just naming the files in the <Files *> bit? I'll give it a try. Unfortunately, it's very difficult to tell that you've gotten it to work, heh :) _________________ http://www.distractionware.com
|
|
Back to top |
|
|
Nephilim Mage
Joined: 20 Jun 2002 Posts: 414
|
Posted: Wed Jul 27, 2005 1:34 pm Post subject: |
[quote] |
|
Yeah, at the very least, you want images to be cache-able.
You should be able to put something like *.php in there where the asterisk is to have it only apply to php files. I *think* you can do a comma-delimited string of files, like:
Code: |
<Files *.php, *.shtml, *.php3>
|
...but I'm not sure - your best bet is to do a little research on the format of .htaccess files. _________________ Visit the Sacraments web site to play the game and read articles about its development.
|
|
Back to top |
|
|
Terry Spectral Form
Joined: 16 Jun 2002 Posts: 798 Location: Dublin, Ireland
|
Posted: Thu Jul 28, 2005 9:18 pm Post subject: |
[quote] |
|
Nephilim: That's exactly right, as it turns out. :) I found a few detailed tutorials on htaccess files, learned a lot, it's all good. Thank you for your suggestions.
However, I've still got the problem! It's driving me ever so slightly crazy... I'm just going to contact the system admins and see if they can do anything about it.
Oh, and by the way, to anyone who cares, I plan to finally update my website tonight. For whatever reason I just keep putting it off... _________________ http://www.distractionware.com
|
|
Back to top |
|
|
Nephilim Mage
Joined: 20 Jun 2002 Posts: 414
|
Posted: Fri Jul 29, 2005 2:52 am Post subject: |
[quote] |
|
Chaotic Harmony wrote: | Nephilim: That's exactly right, as it turns out. :) I found a few detailed tutorials on htaccess files, learned a lot, it's all good. Thank you for your suggestions. |
Glad to help.
Chaotic Harmony wrote: | However, I've still got the problem! It's driving me ever so slightly crazy... I'm just going to contact the system admins and see if they can do anything about it. |
You might try posting a link to the pages in question - someone might be able to notice something in the HTML code that you may have overlooked. _________________ Visit the Sacraments web site to play the game and read articles about its development.
|
|
Back to top |
|
|