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 with that responsibility and long wait time?

Read More

If not, should I be using something else to cache that does have that ability?

Thank you in advance for any advice

Related posts

1 comment

  1. Your issue is not as much priming (which only happens first time) but that cache refreshes in solution you are using are synchronous.

    Transients API is not dealing with updates by itself, it is handled by code that calls it. So it doesn’t implement async updates.

    On other hand there is nothing that prevents implementing async on top of it. It can be done in custom code or making use of generic solution with such functionality, for example WP-TLC-Transients library.

Comments are closed.