Is it the cache? | Performance Magic

Ramblings from a Sysadmin

August 17, 2014

Is it the cache?

We do a lot of support of OpenSource CMS’s at work, and one of them happens to be WordPress.

I recently thought it might be cool to have a bit more of a play with W3-Total-Cache as it is a plugin of choice to assist customer with scaling issues.

Since my blog is massively popular (not!), I decided to use the S3/CloudFront option, presented here.

Well it didn’t work.

Very sad face. All the tests were passing OK, but nothing was changing in the source of my pages.

Putting on my PHP hat, I jumped in and started writing little statements to print out variables and settings using a couple of my usual debug methods:

`We do a lot of support of OpenSource CMS’s at work, and one of them happens to be WordPress.

I recently thought it might be cool to have a bit more of a play with W3-Total-Cache as it is a plugin of choice to assist customer with scaling issues.

Since my blog is massively popular (not!), I decided to use the S3/CloudFront option, presented here.

Well it didn’t work.

Very sad face. All the tests were passing OK, but nothing was changing in the source of my pages.

Putting on my PHP hat, I jumped in and started writing little statements to print out variables and settings using a couple of my usual debug methods:

`

It didn’t take me long to figure out what was going on, and it was staring me right in the face. A setting for Easy AdSense that had ads above the heading literally had them above the XML document type header.

This check if ($buffer != '' && w3_is_xml($buffer)) { was failing and not reporting anything anywhere, but because it was failing, it wouldn’t change anything.

I fixed up the ad placement, and sent in the below patch. Hopefully it helps someone else in the future.

``We do a lot of support of OpenSource CMS’s at work, and one of them happens to be WordPress.

I recently thought it might be cool to have a bit more of a play with W3-Total-Cache as it is a plugin of choice to assist customer with scaling issues.

Since my blog is massively popular (not!), I decided to use the S3/CloudFront option, presented here.

Well it didn’t work.

Very sad face. All the tests were passing OK, but nothing was changing in the source of my pages.

Putting on my PHP hat, I jumped in and started writing little statements to print out variables and settings using a couple of my usual debug methods:

`We do a lot of support of OpenSource CMS’s at work, and one of them happens to be WordPress.

I recently thought it might be cool to have a bit more of a play with W3-Total-Cache as it is a plugin of choice to assist customer with scaling issues.

Since my blog is massively popular (not!), I decided to use the S3/CloudFront option, presented here.

Well it didn’t work.

Very sad face. All the tests were passing OK, but nothing was changing in the source of my pages.

Putting on my PHP hat, I jumped in and started writing little statements to print out variables and settings using a couple of my usual debug methods:

`

It didn’t take me long to figure out what was going on, and it was staring me right in the face. A setting for Easy AdSense that had ads above the heading literally had them above the XML document type header.

This check if ($buffer != '' && w3_is_xml($buffer)) { was failing and not reporting anything anywhere, but because it was failing, it wouldn’t change anything.

I fixed up the ad placement, and sent in the below patch. Hopefully it helps someone else in the future.

``

© Greg Cockburn