Jump to:

23493 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Increase site speed

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 659 Views
  • lozhowlett
    Avatar
    Community Member
    146 Posts

    Increase site speed Link to this post

    Hi Everyone

    We have just launched www.safari.co.uk, and its working really nice - apart from the speed. We really need to improve page load times and optimise the image library.

    Can anyone sign post me to ideas / guidelines. I think there is a lot of performance to be gained in the cache of cropped images that could be served as static image instead of having to pass through the GD library everytime (or is this already happening?).

    Thanks in advance for any pointers!

    Lawrence

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: Increase site speed Link to this post

    Hi,

    Looks like a brochureware site - so http://doc.silverstripe.org/framework/en/reference/staticpublisher - could be a huge win.

    If you want to do a partial cache...
    http://doc.silverstripe.org/framework/en/reference/templates#partial-caching
    http://doc.silverstripe.org/framework/en/reference/templates#calling-templates-from-php-code

    Then you have the more complicated server setup... APC, memcache, varnish (http://en.wikipedia.org/wiki/Varnish_(software)).

    Lastly, of course is analysing your site with something like kcachegrind and improving the code you have added

  • kinglozzer
    Avatar
    Community Member
    142 Posts

    Re: Increase site speed Link to this post

    Images don't get passed through the GD library every time, only when they are first resized. It then checks if a resized image exists and serves it if it does.

    I agree with Swaiba - partial caching & static publishing help a lot, partial caching alone recently saved us about 30% on loading times.

  • lozhowlett
    Avatar
    Community Member
    146 Posts

    Re: Increase site speed Link to this post

    Thanks for this. Also applied these htaccess rules which have helped a lot...

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/html "access plus 7 day"
    ExpiresByType text/js "access plus 7 day"
    ExpiresByType image/gif "access plus 7 day"
    ExpiresByType image/png "access plus 7 day"
    ExpiresByType image/jpg "access plus 7 day"
    ExpiresByType image/jpeg "access plus 7 day"
    ExpiresByType image/ico "access plus 7 day"
    ExpiresByType text/css "access plus 7 day"
    ExpiresByType text/javascript "access plus 7 day"
    ExpiresByType application/x-javascript "access plus 7 day"
    </IfModule>

    <IfModule mod_deflate.c>
    SetOutputFilter DEFLATE
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    # Don't compress images, movies or zip files
    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
    SetEnvIfNoCase Request_URI \.(?:avi|mov|mp3|mp4|rm|flv|swf|mp?g)$ no-gzip dont-vary
    <IfModule mod_headers.c>
    # properly handle requests coming from behind proxies
    Header append Vary User-Agent
    </IfModule>
    </IfModule>

    Will work on the partial cache soon, just need to work out what elements can be cached like that. Also setting up a varnish server as a test.

    Thanks again

  • Devlin
    Avatar
    Community Member
    215 Posts

    Re: Increase site speed Link to this post

    html5boilerplate.com has a nice .htaccess file too.

    Edit: https://github.com/h5bp/html5-boilerplate/blob/master/.htaccess

  • Nobrainer Web
    Avatar
    Community Member
    135 Posts

    Re: Increase site speed Link to this post

    If you missed it, there is also a blog post about performance. I use that as guide for improving performance on sites:
    http://www.silverstripe.org/how-to-improve-website-performance/

    And then i use http://tools.pingdom.com/fpt/ to see where i should improve, and ofcourse also the showqueries=1 url param onsite.

    659 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.