Difference between revisions of "PHP Load TImes"

From CTWUG Wiki
Jump to: navigation, search
(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 ...)
 
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.

Revision as of 17:50, 24 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:

  1. --------------------------------------------------------
  2. 24weeks

<FilesMatch ".*\.(ico|flv|jpg|jpeg|png|gif|js|css|swf)$"> Header set Cache-Control "max-age=14515200, public" </FilesMatch>

  1. -------------------------------------------------------

You can use http live headers plugin for firefox to check if it is work. http live headers download