go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  Simple steps to speed up web page -- server side settings
 
Subject: Simple steps to speed up web page -- server side settings
Author: WebSpider
Posted on: 12/09/2011 07:37:41 PM

1) Take advantage of caching to save the trips for static contents.

Use Expires or Cache-Control:

<IfModule mod_expires.c>

    ### activate mod_expires
    ExpiresActive On

    ### Expire .gif's 1 month from when they're accessed
    ExpiresByType image/gif A2592000

    ### Expire .jpg's 1 month from when they're accessed
    ExpiresByType image/jpg "access 1 month"

    ### Expire everything else 1 day from when it's last modified
    ExpiresDefault "modification plus 1 day"

    ### Apply a Cache-Control header to index.html
    <Files index.html>
        Header append Cache-Control "max-age=3600, must-revalidate"
    </Files>

</IfModule>


Request Header:
Accept-Encoding gzip,deflate,sdch
Accept-Language en-US,en;q=0.8
Connection      keep-alive
Pragma          no-cache
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.3
Host            www.mycompany.com
User-Agent      Mozilla/5.0 (X11; Linux x86_64) 
                AppleWebKit/535.8 (KHTML, like 
                Gecko) Chrome/17.0.942.0 
                Safari/535.8
Accept          */*
Cache-Control   no-cache
Referer         http://www.mycompany.com/


Response Header:
Date            Thu, 24 Nov 2011 00:05:36 GMT
Connection      close
Content-Length  83016
Last-Modified   Mon, 19 Sep 2005 05:31:21 GMT
Server          Apache/2.2.21 (Amazon)
ETag            "22e65-14448-4011940dedc40"
Content-Type    image/gif
Accept-Ranges   bytes
Cache-Control   max-age=2592000
Expires         Sat, 24 Dec 2011 00:26:20 GMT



Replies:


References:

 


 
Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.