As far as SEO concern, Google and other search engine like yahoo, bing and msn like fast loading website and fast website is one of the SEO benefits, in this tutorial I will show you two methods to speed up your site both methods are extremely simple to set up and will dramatically speed up your site.
Note: Please do a backup of your .htacess file first before trying these solutions as you need to edit .htaccess file and any miss configuration will laid your site down.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
<ifModule mod_expires.c>
# 1 YEAR
<filesMatch "\.(ico|pdf|flv)$">
Header set Cache-Control "max-age=29030400, public"
</filesMatch>
# 1 WEEK
<filesMatch "\.(jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=604800, public"
</filesMatch>
# 2 DAYS
<filesMatch "\.(xml|txt|css|js)$">
Header set Cache-Control "max-age=172800, proxy-revalidate"
</filesMatch>
# 1 MIN
<filesMatch "\.(html|htm|php)$">
Header set Cache-Control "max-age=60, private, proxy-revalidate"
</filesMatch>
</ifModule>
|
This can be done either by uncommenting the appropriate lines in the Configuration file, or using the -enable-module=expires and -enable-module=headers arguments to configure (1.3 or greater).
0 comments:
Post a Comment