<p>This isn't an issue with Craft, from the POV that the TTFB should be pretty consistent.  How are you testing it?</p>

<p>My guess would be that the issue is with your hosting. These two articles may help you:</p>

<p><a href="https://nystudio107.com/blog/the-craft-cache-tag-in-depth" rel="nofollow noreferrer">The Craft {% cache %} Tag In-Depth</a></p>

<p><a href="https://nystudio107.com/blog/a-pretty-website-isnt-enough#objective-testing-is-the-key" rel="nofollow noreferrer">A Pretty Website Isn't Enough</a></p>

<p>Run some of the diagnostic tests listed in the second article.</p>

CC BY-SA 3.0
2017-01-04T11:09:12.990Z
Holy smokes those two articles are great!
rjdvsk
CC BY-SA 3.0
2017-01-04T11:16:12.597Z
I've been testing through webpagetest - see a result here: https://www.webpagetest.org/result/170104_1A_8DJV/

As well as Google Insights and Pingdom. All of which were giving me back a high TTFB. Though Cloudflare says to stop worrying about TTFB: https://blog.cloudflare.com/ttfb-time-to-first-byte-considered-meaningles/ - though I suspect a 1.596s TTFB would still be considered high.
rjdvsk
CC BY-SA 3.0
2017-01-04T14:06:35.843Z
Marking this as the answer. The two articles linked gave me a greater understanding of whats going on behind the scenes and lead me to test the server with just a static file - TTFB was still high - time to find a different host.
rjdvsk
CC BY-SA 3.0
2017-01-04T08:21:18.753Z
2017-01-04T08:21:18.753Z
andrew.welch
<p>I've just launched my <a href="https://www.madebydusk.com/portfolio/the-norway-collection" rel="nofollow noreferrer">new site here</a> and I'm playing around with the caching options with Craft. I'm hosting my site with Siteground which gives me access to their Supercacher option, it offers Static cache and Memcached, both of which I have enabled.</p>

<p>I have configured Craft to use Memcached via the general.php config file <code>'cacheMethod' =&gt; 'memcache'</code> and placed the memcache.php file into the config directory as well with <code>'useMemcached' =&gt; true,</code> set to true and my host to <code>'host' =&gt; 127.0.0.1,</code> plus the correct port that is provided by my host. I've also got Cloudflare CDN running which is taking care of a lot of the heavy lifting.</p>

<p>I've also wrapped <code>{% cache %}</code> tags around the mainly static content.</p>

<p>However I'm still left feeling slightly uneasy about my TTFB and site performance, so I have some questions:</p>

<ol>
<li>Should the IP address for <code>'host'</code> in memcache.php be wrapped with quotes? I saw <code>"localhost"</code> was in the default file but typically IP addresses are not, so I didn't</li>
<li>My TTFB has been wildly inconsistent, ranging anywhere between 200ms up to 2s. What is the best way to troubleshoot such an issue with Craft? Or is this more of a host issue?</li>
<li>I'm using AJAX page transitions based off this article: <a href="https://designbycosmic.com/journal/craft-cms-ajax-page-transitions-with-history-pushstate" rel="nofollow noreferrer">https://designbycosmic.com/journal/craft-cms-ajax-page-transitions-with-history-pushstate</a> - could this be messing things up?</li>
</ol>

<p>I appreciate any feedback or pointers people may offer because I'm feeling a little lost/overwhelmed at the moment. cheers!</p>

CC BY-SA 3.0
2017-01-04T14:04:42.823Z
After some further testing with a static html file on the server, I'm seeing some suspect TTFB numbers, like so: https://www.webpagetest.org/result/170104_Z4_DMQE/
rjdvsk
<cache><performance>
Caching and TTFB with Craft
# Caching and TTFB with Craft

(Asked by: username_0 on 2017-01-04)

I've just launched my [new site here](https://www.madebydusk.com/portfolio/the-norway-collection) and I'm playing around with the caching options with Craft. I'm hosting my site with Siteground which gives me access to their Supercacher option, it offers Static cache and Memcached, both of which I have enabled.

I have configured Craft to use Memcached via the general.php config file `'cacheMethod' => 'memcache'` and placed the memcache.php file into the config directory as well with `'useMemcached' => true,` set to true and my host to `'host' => 127.0.0.1,` plus the correct port that is provided by my host. I've also got Cloudflare CDN running which is taking care of a lot of the heavy lifting.

I've also wrapped `{% cache %}` tags around the mainly static content.

However I'm still left feeling slightly uneasy about my TTFB and site performance, so I have some questions:

1. Should the IP address for `'host'` in memcache.php be wrapped with quotes? I saw `"localhost"` was in the default file but typically IP addresses are not, so I didn't
2. My TTFB has been wildly inconsistent, ranging anywhere between 200ms up to 2s. What is the best way to troubleshoot such an issue with Craft? Or is this more of a host issue?
3. I'm using AJAX page transitions based off this article: <https://designbycosmic.com/journal/craft-cms-ajax-page-transitions-with-history-pushstate> - could this be messing things up?

I appreciate any feedback or pointers people may offer because I'm feeling a little lost/overwhelmed at the moment. cheers!

**Tags:** cache, performance
> **Comments:**
> **username_0**: After some further testing with a static html file on the server, I'm seeing some suspect TTFB numbers, like so: https://www.webpagetest.org/result/170104_Z4_DMQE/  

---

## 1 answers

### Answer by username_1 on 2017-01-04. Score: 3 | Accepted answer

This isn't an issue with Craft, from the POV that the TTFB should be pretty consistent. How are you testing it?

My guess would be that the issue is with your hosting. These two articles may help you:

[The Craft {% cache %} Tag In-Depth](https://nystudio107.com/blog/the-craft-cache-tag-in-depth)

[A Pretty Website Isn't Enough](https://nystudio107.com/blog/a-pretty-website-isnt-enough#objective-testing-is-the-key)

Run some of the diagnostic tests listed in the second article.

> **Comments:**
> **username_0**: Holy smokes those two articles are great!  
> **username_0**: I've been testing through webpagetest - see a result here: https://www.webpagetest.org/result/170104_1A_8DJV/  As well as Google Insights and Pingdom. All of which were giving me back a high TTFB. Though Cloudflare says to stop worrying about TTFB: https://blog.cloudflare.com/ttfb-time-to-first-byte-considered-meaningles/ - though I suspect a 1.596s TTFB would still be considered high.  
> **username_0**: Marking this as the answer. The two articles linked gave me a greater understanding of whats going on behind the scenes and lead me to test the server with just a static file - TTFB was still high - time to find a different host.  

---

