Difference between revisions of "PHP Load TImes"
(New page: 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 ...) |
m (PHP servers reduce browser load times and bandwidth with content expirey headers moved to PHP Load TImes) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 3: | Line 3: | ||
for static content such as css,js,gif,jpg,extra files | for static content such as css,js,gif,jpg,extra files | ||
were their content will probably never change for weeks on hand. | were their content will probably never change for weeks on hand. | ||
− | + | <br><br> | |
− | '''The benefits are:''' | + | '''The benefits are:'''<br> |
Reduced bandwidth usage and load on the whole ctwug network, | Reduced bandwidth usage and load on the whole ctwug network, | ||
Line 11: | Line 11: | ||
Ex-termly faster load and rendering of web pages on the clients side browser, | Ex-termly faster load and rendering of web pages on the clients side browser, | ||
even when the network is under load. | even when the network is under load. | ||
+ | <br> | ||
+ | <br> | ||
The process is pretty simple for php server. | The process is pretty simple for php server. | ||
Line 18: | 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] |
Latest revision as of 18:09, 9 May 2013
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