Forum Moderators: phranque
Is this response OK? Does it have to validate? Thanks.
http://www.example.com/about-us.shtml
Date Thu, 20 Apr 2006 01:45:15 GMT
Expires 5 weeks 6 days ago (Thu, 09 Mar 2006 01:48:28 GMT)
Cache-Control max-age=-3628607
Last-Modified -
ETag -
Content-Length - (actual size: 6107)
Server Apache/1.3.34 (Unix) mod_fastcgi/2.4.2 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_ssl/2.8.25 OpenSSL/0.9.7a PHP-CGI/0.1b
This object has been deliberately marked stale. It doesn't have a validator present. It doesn't have a Content-Length header present, so it can't be used in a HTTP/1.0 persistent connection. The clock on this Web server appears to be set incorrectly; this can cause problems when calculating freshness.
I had to modify the .htaccess file in order to get the expires server header and am hoping that it is correct.
I used the code in .htaccess like this:
### activate mod_expires
ExpiresActive On
### Expire everything else 1 day from when it's last modified
ExpiresDefault "modification plus 1 day"
thanks,
I also recommend using the client-load-time-relative Expires format. That is, expire the document an hour or a day after the client loads it. Otherwise, any document you don't update regularly will have an expiry date in the past (as shown in your example above), and you will lose a good bit of the advantage of client-side and caching-proxy caching.
Jim
So I should replace this code:
# Expire everything else 1 day from when it's last modified
ExpiresDefault "modification plus 1 day"
with this code then:
# Expire all docs and images by default to 5 days in future
ExpiresDefault "access plus 1 hour"
# Expire .gif's 1 month from when they're accessed
ExpiresByType image/gif A2592000
If the page is accessed within every hour all the time, will it ever expire then?
I use a 25 year expire on the images and am careful to change the name or location when the image changes so people get the correct image.
If you use a 1 month expire on the images, after the end of the month from when they first downloaded the image I found that they would do a check to see if it were the same every time they accessed the image and get a 304. The objective is to avoid the 304's. With a 25 year expire there is much less checking, not 100% less but much less.
There are some side issues on the headers if you use mod_gzip where you need to turn off mod_gzip in the image folders and think about how to set headers if you are using includes. But gzipping is another whole topic.
Is it recommended to set both "Last modified" and "expires". Won't "last modified" show that it is 1 month old say, and Google etc. will not bother to re-index it even if it is set to expire in 1 day?
What is the purpose of XbitHack? Is it basically:
1. to set the last modified date before including all my SSI's. So it is faster for the engines?
2. so the "last modified" date is set because SSI and php parsed files don't by default set it?
I checked the file permissions of index.shtml of my home page and it is set to 644. When I changed it to 654, the last modified date is now set! Sound good and secure? -sorry coming from windows world.
(By the - way above, I was asked if it was a dynamically created site - I said no, but I do use SS includes for headers, footers kind of thing)
cheers,