What are ETags?
ETag is a standard used for determining whether the client (web browser) already has the latest version. If it has, it’s simply loaded from local cache. If not, the new version is requested.
An ETag is a hash generated based on either the inode number, the last modified time and / or the size (in bytes) of a file. The default behaviour in Apache webserver is to use all properties to generate the ETag.
What’s the problem with ETags?
Although etags do no harm in a single server set-up, it is harmful when you have multiple servers replication the served files. The problem is that the generated ETags most likely differ per server. So when the client re-requests an un-updated file on a different server than the last time the ETags do not much and a new version is requested, while this would not be necessary. This hurts performance (page load). You can find more information about this in the ‘Configure ETags‘ article on the Yahoo Developer Network.
How To Disable ETags in httpd.conf
To disable the use of ETags in the Apache webserver simply put the following FileETag directive in your httpd.conf:
This will disabled the use of ETags completely.
I installed a fresh WordPress on a brand new VPS. No matter how I change the settings of permalinks, it is always giving me 404 error for all pages except Homepage.
Later I google it and find the solution from the official site.
* Apache web server with the mod_rewrite module installed
* In WordPress’s home directory,
o The FollowSymLinks option enabled
o FileInfo directives allowed (e.g. AllowOverride FileInfo or AllowOverride All)
o An .htaccess file (if this file is missing, WordPress will try to create it when you activate “pretty” permalinks)
o If you want WordPress to update the .htaccess file automatically, WordPress will need write access to the file.
For my situation, it is because of options of Apache.
I edited the httpd.conf and added following options.
Continue reading “Apache requirement for WordPress Pretty URL”
Last Friday, I put an .htaccess file into one folder of my site. The function of this htaccess is to make it auto redirect to other path.
The problem is it is not working. I do have use this kind of code many times. Why it does not work any more?
It looks the Apache works like there is no this .htaccess file here. I think it must be something wrong in my httpd.conf setting.
After double checking with Apache tutorial, I found the answer.
Continue reading “Why .htaccess does not work”