Support forums > Installation / Update help

Increase your website speed on Apache : .htaccess tweak you could do

(1/9) > >>

Emmanuel:
Here is a little tweak you could add to your .htaccess to increase the website speed - (you can locate the .htaccess text file @ the root folder of your installation. If you cant view it - use your legacy file manager, e.g. cPanel ).

ADD the following code to your installed .htaccess
*** do NOT replace the current .htaccess file ***, ADD the following code at the beginning of it :

--- Code: ---## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/png A2592000
ExpiresByType image/x-icon A2592000
ExpiresByType text/css A86400
ExpiresByType text/javascript A86400
ExpiresByType application/x-shockwave-flash A2592000
#
<FilesMatch "\.(gif¦jpe?g¦png¦ico¦css¦js¦swf)$">
Header set Cache-Control "public"
</FilesMatch>
</IfModule>
## EXPIRES CACHING ##

--- End code ---

This leverages the cache and increases your site speed.


You can also enable gzip 'ed served content by adding up the following snippet:


--- Code: ---#Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
</ifmodule>
#End Gzip

--- End code ---

These instructions tell your server to compresse the specified files, decreasing the size of the transferred chunks, hence improving the loading speed but may also increases the server load. Anyway, always test with the great YSlow extension to determine the gain according to your server config, additional improvements, aso..


P.S.  Tweak the .htaccess only if you know what you are doing. Messing up with .htaccess may crash your site.
*** BACKUP YOUR ORIGINAL .htaccess file BEFORE UPLOADING THIS TWEAKED VERSION ***

P.P.S. : Another additional important "speed increasing tip" is given here:
http://doc.osclass.org/Combine_.js_and_.css_files_to_make_OSClass_load_faster

RoyalC:
great
thanks.

cutabovehost:
Great advice thanks for sharing.

Emmanuel:
One another easy transparent solution that does NOT require any change to the code is to use the Varnish cache.

Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any HTTP server.
Transparent to the PHP application! Cache requests and serve results, bypassing the underlying app. Clever!

If you have SSH access to your server, you can install it:
https://www.varnish-cache.org/

web2graphics:

--- Quote from: emanwebdev on August 22, 2012, 02:54:41 pm ---One another easy transparent solution that does NOT require any change to the code is to use the Varnish cache.

Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any HTTP server.
Transparent to the PHP application! Cache requests and serve results, bypassing the underlying app. Clever!

If you have SSH access to your server, you can install it:
https://www.varnish-cache.org/

--- End quote ---
Thanks a lot for the tips. Have you implemented those in your osclass website?if yes can we take a look?  -thanks

Navigation

[0] Message Index

[#] Next page

Go to full version