Are there any server requirements for WordPress transients to work properly?

Background Info

I sell WordPress themes where I include a Twitter widget. In the widget I use a WordPress transient that refreshes every 3 hours to cache the Tweets. I’ve got thousands of people using this and it seems to work for just about everyone. Also, I’ve done little tests on my end to ensure I know the cache is working properly with how I have everything setup.

However, I’ve run into maybe 2 or 3 buyers where it’s apparent that the cache is not working at all on their servers.

Note: I can tell because they keep getting timeout issues as they’re hitting the Twitter API more than the allowed 150 times in an hour.


The Question

So, are there any reasons why someone’s specific web server could have problems with WordPress transients? Or maybe something specific to someone’s WordPress configuration? Is there anything else I could be overlooking?

2 Answers
2

I had a similar problem once with an aggressive database cache: the first check for an existing transient returned nothing – which was okay – but after I created the transient, I didn’t get it, because the empty cached result was always returned. So I built a dozen duplicated transients until I found the issue.

Ask your clients if it happens after they disabled the data base cache. You could filter the 'query' and insert a SQL_NO_CACHE before you check the transient. Make sure to remove the filter afterwards.

Leave a Comment