I have a few widgets and they're being built-up every time someone accesses their logged-in homepage.

I assume this is so that everything works nicely.

Unfortunately, this is a tremendous performance hog for when you have, say, a page builder and other few things.

In a way, I'd like to do:


Where as this would stop my widget from reloading, unless toyed with.

So, unless the context is customizer\widgets\edit-widget, simply serve a cached version of it.

How could I even approach it?

  • Do you want to cache any widget, or widgets you have developed yourself? To cache any widget, you might want to look at something like github.com/Rarst/fragment-cache. – swissspidy Jan 17 '18 at 21:02
  • @swissspidy Amazing. I read on it, but I'd want something that I can do on my own. I'll read the plugin's core and see what it does, but what should I look at? – Jonathan Guerin Jan 17 '18 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.