Activity Stream
48,167 MEMBERS
61085 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 5 123 ... LastLast
Results 1 to 10 of 42
  1.     
    #1
    Moderator
    NewEraCracker's Avatar

    Default Improve your site performance, improve SEO

    Hello,

    Today I'll present you a shameful reality that causes Internet to be slow. Its called careless webmasters/sysadmins.

    You certainly noticed some sites are faster than another, this is due several reasons, one of them is non-proper cache headers and non-proper gzip.

    You can test your site speed here:
    GTmetrix | Website Speed and Performance Optimization

    But now how do I improve it?

    If you are using apache its pretty easy.
    Open your .htaccess inside www or the dir that represents the root of webserver and add (if doesn't exist):
    Code: 
    <FilesMatch "\.(gif|ico|jpg|jpeg|png|flv|swf|pdf|mp3|mp4|xml|txt|js|css)$">
    Header set Cache-Control "max-age=691200"
    </FilesMatch>
    
    <IfModule mod_deflate.c>
    	AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css
    	AddOutputFilterByType DEFLATE application/javascript application/x-javascript
    	AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml
    </IfModule>
    Please note sometimes minor issues may come from mod_deflate, if you face blank pages or similar side-effects remove from .htaccess
    Code: 
    <IfModule mod_deflate.c>
    	AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css
    	AddOutputFilterByType DEFLATE application/javascript application/x-javascript
    	AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml
    </IfModule>
    If you are using nginx its easy as well

    Open up nginx.conf and add in http directive
    Code: 
        ## Compression
        gzip on;
        gzip_buffers      8 8k;
        gzip_comp_level   5;
        gzip_http_version 1.0;
        gzip_min_length   1k;
        gzip_types        text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/gif;
        gzip_vary on;
    Now add in server directive
    Code: 
            # add expire headers
            location ~* ^.+.(gif|ico|jpg|jpeg|png|flv|swf|pdf|mp3|mp4|xml|txt|js|css)$ {
                expires 8d;
            }
    Save

    Now reload nginx.
    Code: 
    nginx -s reload

    Regards,
    NewEraCracker
    NewEraCracker Reviewed by NewEraCracker on . Improve your site performance, improve SEO Hello, Today I'll present you a shameful reality that causes Internet to be slow. Its called careless webmasters/sysadmins. You certainly noticed some sites are faster than another, this is due several reasons, one of them is non-proper cache headers and non-proper gzip. You can test your site speed here: GTmetrix | Website Speed and Performance Optimization But now how do I improve it? Rating: 5
    Trusted: Dom, l0calh0st, 0ccul7, robert420
    Find all threads started by NewEraCracker

  2.   Sponsored Links

  3.     
    #2
    Respected Developer
    Website's:
    wrzc.org
    One propblem with this is mod_deflate is off by default on Apache servers and you have to enable it first. If your on shared hosting and it's not enabled don't even bother to request it to be enabled as it's noob or cheap hosting so just move instead.

  4.     
    #3
    <FilesMatch "\.(gif|ico|jpg|jpeg|png|flv|swf|pdf|mp3|mp4|xml|t xt|js|css)$">
    Header set Cache-Control "max-age=691200, must-revalidate"
    </FilesMatch>
    This caches the given file types and make website faster ?

  5.     
    #4
    Moderator
    NewEraCracker's Avatar
    In fact it seems I did a small mistake try this instead to send cache-control headers:
    Code: 
    <FilesMatch "\.(gif|ico|jpg|jpeg|png|flv|swf|pdf|mp3|mp4|xml|txt|js|css)$">
    Header set Cache-Control "max-age=691200"
    </FilesMatch>
    It sends cache headers with request.

    Let me show you:
    Code: 
    GET /links.txt HTTP/1.1
    Host: deioncube.in
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; pt-PT; rv:1.9.1.11) Gecko/20100701 Firefox/3.5.11
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: pt-pt,pt;q=0.8,en;q=0.5,en-us;q=0.3
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Connection: keep-alive
    Referer: http://deioncube.in/
    
    
    HTTP/1.1 200 OK
    Server: nginx
    Date: Tue, 07 Sep 2010 15:47:55 GMT
    Content-Type: text/plain
    Content-Length: 376
    Last-Modified: Wed, 01 Sep 2010 00:17:40 GMT
    Connection: keep-alive
    Expires: Wed, 15 Sep 2010 15:47:55 GMT
    Cache-Control: max-age=691200
    Accept-Ranges: bytes
    
    
    GET /links.txt HTTP/1.1
    Host: deioncube.in
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; pt-PT; rv:1.9.1.11) Gecko/20100701 Firefox/3.5.11
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: pt-pt,pt;q=0.8,en;q=0.5,en-us;q=0.3
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Connection: keep-alive
    Referer: http://deioncube.in/
    If-Modified-Since: Wed, 01 Sep 2010 00:17:40 GMT
    Cache-Control: max-age=0
    
    
    HTTP/1.1 304 Not Modified
    Server: nginx
    Date: Tue, 07 Sep 2010 15:47:56 GMT
    Last-Modified: Wed, 01 Sep 2010 00:17:40 GMT
    Connection: keep-alive
    Expires: Wed, 15 Sep 2010 15:47:56 GMT
    Cache-Control: max-age=691200
    Trusted: Dom, l0calh0st, 0ccul7, robert420
    Find all threads started by NewEraCracker

  6.     
    #5
    Banned
    Thanx I just did this and worked... though I still needing more tricks

    Before


    After


    Thanx

  7.     
    #6
    Moderator
    NewEraCracker's Avatar
    make sure you tried updated version
    Trusted: Dom, l0calh0st, 0ccul7, robert420
    Find all threads started by NewEraCracker

  8.     
    #7
    Banned
    Website's:
    KWWHunction.com
    @ new era

    update ur thread i almost missed it

  9.     
    #8
    Moderator
    NewEraCracker's Avatar
    1st post is updated
    Enjoy
    Trusted: Dom, l0calh0st, 0ccul7, robert420
    Find all threads started by NewEraCracker

  10.     
    #9
    Member
    Didn't change much, but still thanks

  11.     
    #10
    Google Corp.
    I use:
    Code: 
    ExpiresActive On
    ExpiresDefault "access plus 4 weeks"
    then:
    Code: 
    ExpiresByType image/png "access plus 2 months"
    ExpiresByType image/jpg "access plus 2 weeks"
    for specific types.
    Life asked Death: "Why do people love me, but hate you?"
    Death responded: "Because you're a beautiful lie and I'm the painful truth."


Page 1 of 5 123 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 14
    Last Post: 13th Jan 2011, 04:02 PM
  2. How to improve site ranking...
    By GouroB in forum General Discussion
    Replies: 2
    Last Post: 16th Oct 2010, 09:59 PM
  3. Can someone improve VBSEO my site?
    By anti-human in forum vBulletin
    Replies: 4
    Last Post: 26th Jan 2009, 01:07 AM

Tags for this Thread

BE SOCIAL