Just wanted to check in to see if what i'm seeing is reasonable. Just trying to tweak the performance of a single-page Craft site, and basically working backwards to find bottlenecks. Following all the suggested items (devMode off, static assets caching, minimise db calls, etc).

However, working my way all the way back to a blank template file (no code at all), no plugins enabled, the page still take 250-300ms to load nothing at all. All this while running locally via MAMP.

Is this an expected speed? I'm aware thats pretty fast, but would've thought locally would be near instantaneous. This will only get worse on a server (especially shared hosting).


It's on our list to improve the 2-300ms time to first byte you're seeing as well, but that won't happen until after Yii 2/Craft 3.

  • Sure, glad that it's not something I'm missing! Like I mentioned, not a huge drama at the moment :) – crawf Nov 19 '14 at 22:12

MAMP isn't really tuned for performance either. And also keep in mind Time to First Byte is not the only indicator of a fast website. You should consider overall perceived time and actual download time as factors as well.

CloudFlare talked about one aspect of this on their blog... for example: with Gzip compression, the web server has to wait while it compresses the output then send it along. That adds to your TTFB. So on first blush, gzip compression would appear to be a bad thing but in reality, your overall download time and file size shrink, and as a result, it's an easy win.

If your content doesn't change all that much, when you get your Craft site up live, you might also want to consider caching on the server level as well, either with Nginx (fastcgi_cache) or something like Varnish in front of Apache. Those layers add complexity (e.g. when and how to clear the cache?) but it'll get you super fast output if that's your goal.

  • Very good points @RitterKnight - I'm also considering Fastly as outlined here - onedesigncompany.com/news/… – crawf Nov 21 '14 at 1:41
  • Yes, regardless of whether you go for a static page cache or not, a CDN is is going to help your images and other static assets and unlike other CMSes, Craft makes it super uncomplicated to set it up. Fastly is awesome if you have a ton of traffic but their minimum spend is $50 so you may want to consider other CDNs too. AWS lets you use Cloudfront in their free tier, something to consider if your traffic is under 50 GB. – RitterKnight Nov 22 '14 at 21:35
  • Yeah, Fastly does looks sweet, but soon noticed that $50 min :) Will definitely check out CloudFront. Thanks so much for your thoughts and suggestions! – crawf Nov 23 '14 at 12:23
  • 1
    Also - Craft makes everything uncomplicated to setup :) – crawf Nov 23 '14 at 12:24

There is an excellent article on optimizing performance in craft from Pat Pohler you might want to check out. He goes through every detail meticulously looking for speed load gains. Good read.

  • It is indeed a great article, and one that I've followed to the letter. However, still getting that delay until first byte as Brad mentions. Thanks! – crawf Nov 19 '14 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.