![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
|||||||
| FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Optimization Techniques Ways to optimize your website so that you rank better on the search engines. Questions on how to change your site so it attacts more visitors, and other similar topics. |
|
|
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
So the PHP way is 1) put AddType application/x-httpd-php .html in the top of your HTAccess file (to tell your webhost server to recognize PHP in HTML pages), then
2) put <meta name="Expires" content="<?echo gmdate ('D, d M Y H:i:s', time()+24*60*60)?>"> in the head of each page so when a browser downaloads the page (say today 9/24) the browser will use 9/25 as an expiration date. If on 11/25 the browser is asked to download the page again, it will see the 9/25 expiration date it saved, understand that 9/25 has pased, and go to the internet for a fresh copy and display the fresh copy, and calculate a new expiration date, 11/26. ((And you could set the expiration to anytime in the future like <meta name="Expires" content="<?echo gmdate ('D, d M Y H:i:s', time()+8*00*00)?>"> for 8 hours ahead.)) ((And with the above ExpiresActive On ExpiresByType text/html "access plus 1 day" is not needed becuase it's part of mods not PHP.)) It sounds like you can't just put in an old date as a expiration date for some technical reason. Also, it sounds like the added anti-caching code won't help pages that were cahed without the anti-caching code. How does this sound? Thanks Jim, Roger
__________________
Nutritional Deficiencies Cause Many Medical Diseases Last edited by Actual; 09-24-2007 at . |
|
|||
|
Jim,
I got AddType application/x-httpd-php .html .php .htm onto my HTAcess file and my webost (Bluehost) wanted AddHandler application/x-httpd-php .html .php .htm on the next line after. I tried a php time stamp and it worked fine. Checking the expire function is getting tricky. It seems no matter what settings I try in Firefox (Tools, Options, cache, settings) , Firefox always goes to the internet for a fresh copy. I have the expires code on my /cone.html page. What's an easy way to check the no caching function? Thanks, Roger
__________________
Nutritional Deficiencies Cause Many Medical Diseases Last edited by Actual; 10-03-2007 at . |
|
|||
|
Jim,
Jim the Expires line <meta name="Expires" content="<?echo gmdate ('D, d M Y H:i:s', time()+00*05*00)?>"> says that the page expires 5 minutes from now - right? Can you forsee any problems with a five minute expiration time? Thanks, Roger
__________________
Nutritional Deficiencies Cause Many Medical Diseases |
|
|||
|
I think that's what I'll do, five minutes.
Thanks, Roger
__________________
Nutritional Deficiencies Cause Many Medical Diseases |
|
|||
|
Jim,
When you get some free time, The expires line <meta name="Expires" content="<?echo gmdate ('D, d M Y H:i:s', time()+00*05*00)?>"> works great except I don't understand the results. (I changed the expire time to 8 minutes.) When I brought up the first page I used it on and went to page source it showed an expire time of <meta name="Expires" content="Tue, 09 Oct 2007 17:10:50"> yet it was 1:12 (13:12) on the East Coast. I thought Zurich time was 5 hours off? Any way, I would think the expire time would be close to 13:20, that would make my math 3:50 off. Where did the 3 come from, and since time zones are in 1 hour increments, where does the 50 come from? Thanks, Roger
__________________
Nutritional Deficiencies Cause Many Medical Diseases Last edited by Actual; 10-09-2007 at . |
|
|||
|
Jim,
Today I compared the View Source time to my computer clock and the difference was 1:52. So what is the East coast UTC+ time? If I wanted an expiration of 8 minutes in the future would it be UTC+X+08(i)? Thanks, Roger
__________________
Nutritional Deficiencies Cause Many Medical Diseases |
|
|||
|
Jim,
With this code <meta name="Expires" content="<? echo gmdate ('D, d M Y H:i:s', time()+00*05*00)?>"> It appears that D, d, M, Y, H, i and s are the format variables for the values to the right, 00 05 and 00. That capital D is for the text of the Day (ie "Tuesday"). If this PHP code isn't being used to place a date on a web page, it makes me wonder if browsers will create an expiration date using D. If I want to leave the hours parameters (00) open to be able to easily make changes in the future, same for minutes (08), and I guess seconds (00), will this code do the same thing: <meta name="Expires" content="<? echo gmdate ('H:i:s', time()+00*05*00)?>"> ? Thanks Jim, Roger
__________________
Nutritional Deficiencies Cause Many Medical Diseases |
![]() |
| Thread Tools | |
| Display Modes | |
|
|