Articles of caching

How to handle is_user_logged_in() with w3 total cache

I have a site that allows user registration and login but not via the standard wp-login.php etc – it’s all done within the theme and a bit of s2member as well. I’ve been encountering problems where, with page caching enabled, my code shows either a login button or a ‘your account’ button, showing cached material. […]

Where should a plugin or widget cache its results?

Where should a plugin cache its re-usable results? I have read the code of several well-used WordPress plugins, and it seems that the answer is not consistent. I have written several plugins myself, and I store things in a cache directory. But I just picked the location of the directory out of a hat, and […]

What is the best way to count and display the number of posts?

I have a section in my site where I display the 10 most popular posts. Now, I want to display a number, from 1 to 10, besides each post. Like this: Top 10 posts post a post b post c and so on… I implemented a counter inside the while loop. I initialized the counter […]

Is using WP Transients to save external data for a plugin the best/right way?

I am developing a plugin which relies on external data to be fetched from time to time. To speed things up, I´d like to cache the received data and refresh it in intervals of 10 or 15 minutes. This will be no big problem because the external server will only refresh the data in intervals […]

WordPress Caching – Transients API or “update_user_meta ” Cronjob?

I’m trying to set user meta based on queries. Basically, things like IF the query returns true, set this or if not, set this (or don’t set it, if it is true). This works great but the problem is I currently make the call EVERTYIME to check true or false which I know is bad […]

Transient API and caching Plugins

Hello wordpress NINJAS…. I am crazy about transient api and I have implemented it in my theme.My question is If I use transient api is it required caching plugin? (I hate plugins!!!) If I use transient and caching ,how will be the result? Can I use transient against caching plugin? Is caching plugin and transient […]

Cache Get_posts

I have a query (see below) that gives a list of 10 news items ordered by the meta value “event_date” and filtered so that only posts earlier than today are displayed. This query is taking two seconds to process, so I am looking for a simple way to cache the results to get the load […]

Is priming a Transient Cache possible?

I’m currently using WordPress Transient Caching when querying images I’ve uploaded and tagged. Using Transient Caching has really sped up these queries once they are cached, but unfortunately, once the cached query expires it is only cached again when someone loads that page. Is it possible to preload/prime transient caches so users don’t get stuck […]

Transient not working for custom loops

I’m working at a WordPress theme. Since I need to display featured posts, related posts, some widgets with recent posts and so on, I need to use multiple custom loops. Because of this, the number of database queries have also increased. In an attempt to optimize the theme for better performance I came across http://codex.wordpress.org/Transients_API […]

How to archive a wordpress site (make it read only)

Is it possible to make a WordPress deployment read-only? For a website that won’t be updated, I’d like to make it read-only/static, so the archive is there but nobody can post, so I don’t have to deal with breaches and updates?