Difference between revisions of "PHP Load TImes"
Line 20: | Line 20: | ||
Append the following code to the file and save: | Append the following code to the file and save: | ||
− | + | ||
− | + | -------------------------------------------------------- | |
+ | <nowiki> | ||
<FilesMatch ".*\.(ico|flv|jpg|jpeg|png|gif|js|css|swf)$"> | <FilesMatch ".*\.(ico|flv|jpg|jpeg|png|gif|js|css|swf)$"> | ||
− | Header set Cache-Control "max-age=14515200, public" | + | Header set Cache-Control "max-age=14515200, public" |
</FilesMatch> | </FilesMatch> | ||
− | + | </nowiki> | |
+ | ------------------------------------------------------- | ||
You can use http live headers plugin for firefox to check if it is work. | You can use http live headers plugin for firefox to check if it is work. | ||
[https://addons.mozilla.org/en-US/firefox/addon/live-http-headers/ http live headers download] | [https://addons.mozilla.org/en-US/firefox/addon/live-http-headers/ http live headers download] |
Revision as of 12:32, 25 February 2011
For all those that host web server on the ctwug network
please make sure that you setup the content expire headers
for static content such as css,js,gif,jpg,extra files
were their content will probably never change for weeks on hand.
The benefits are:
Reduced bandwidth usage and load on the whole ctwug network, because these files are not load from the server for every page.
Ex-termly faster load and rendering of web pages on the clients side browser,
even when the network is under load.
The process is pretty simple for php server. Create a file with the name of .htaccess in the root directory hosting directory usually the wwwroot, httpdocs folder if it doesn't exist already. Then edit that file with a text editor.
Append the following code to the file and save:
<FilesMatch ".*\.(ico|flv|jpg|jpeg|png|gif|js|css|swf)$"> Header set Cache-Control "max-age=14515200, public" </FilesMatch>
You can use http live headers plugin for firefox to check if it is work. http live headers download