10 second TTFB on individual files

Please take a look at my test result: http://www.webpagetest.org/result/141004_Z4_FVN/

As you can see, there are four WordPress theme files that are taking over 10 seconds to load, which is making every page on the site take more than 12 seconds until “start render”.

I have tried disabling W3 total cache and have also updated my theme to the latest version.

I am using Amazon Cloudfront as a CDN (which should have automatically been disabled when I disabled W3).

This only started happening a couple of days ago.

Any ideas what this could be and how to fix it? Thanks.

Make sure you run more than 1 test just to make sure you don’t have an outlier (from the sound if it you might already have done that).

Those 5 files all appear to be served from the main www domain so they are not being served through cloudfront and are all calling into php.

It looks like your main site is also behind CloudFlare (which shouldn’t be a problem but you don’t really need 2 different CDN’s). You might want to reach out to CloudFlare and see why those requests are not being cached. It could be that they disable caching for resources with a .php extension or with query params even though the response headers say it is cacheable and they have css/js mime types.

Ultimately, if you can figure out why those 5 requests are SOOOO expensive on your server, everything will be a lot faster anyway. The main HTML seems to respond fast enough so it has to be something in the app code specific to those requests.

Thanks for the reply Patrick.

I disabled Cloudflare as well as W3 Total cache (running several tests after each and checking the file origins).

The problem remains, even without any caching running!

Latest test result: http://www.webpagetest.org/result/141006_7A_14X7/1/details/

I guess it must be a theme issue.

Is it worth approaching the theme author or getting a developer to take a look? Thanks.

The main problem is certainly with the theme but the responses are marked as cacheable so CloudFlare should be able to hide the problem pretty effectively if you can figure out why they aren’t caching those resources. If it’s just a quick settings change in the control panel you might be able to get most of the win with minimal effort.

To fix the root cause is going to require getting a developer involved (either the theme author or an outside developer).

Got it fixed. The theme author had acknowledged the problem and released a fix, but just updating the theme wasn’t enough. One has to go to the theme settings in WordPress and save the options so that static files are generated (?).

There is still a 3 second TTFB on the server (http://www.webpagetest.org/result/141006_WZ_18MC/) but that’s a lot better than the previous 12 seconds. Now to fix that issue!

Thanks for your help Patrick – much appreciated.

“It looks like your main site is also behind CloudFlare (which shouldn’t be a problem but you don’t really need 2 different CDN’s). You might want to reach out to CloudFlare and see why those requests are not being cached. It could be that they disable caching for resources with a .php extension or with query params even though the response headers say it is cacheable and they have css/js mime types.”

Just thought I would clarify in the event anyone else stumbled across this…

CloudFlare caches by file extensions & not mime types. The default CDN would not cache .php or .html by default, but you could look at using PageRules to extend it beyond the static content we would cache automatically.