Plugin Support
qtwrk
(@qtwrk)
unfortunately no , our plugin does not cache database query , best thing you can try is the object cache , but you may need to modify a bit the widget source code to utilize the object cache if it doesn’t use it by default.
I understand. Can you give sample of utilizing widget?
(I have 20+ big sites with LiteSpeed but all is super fast, I don´t know why Query monitor say its slow)
Plugin Support
qtwrk
(@qtwrk)
basically , you just need to use wp_cache_set()
or wp_cache_add()
, and wp_cache_get()
functions
in place where your widget does the query , just imagine here
$result = query blah blah blah;
wp_cache_set('widget_object1', $result, 'widget_cache', 3600); // this create an object cache with name widget_object1 , with TTL to 3600 seconds
and then from where your plugin uses this query result
$result = wp_cache_get('widget_object1');
to retrieve it from object cache directly , instead of run database query
ref: https://developer.wordpress.org/reference/functions/wp_cache_set/
*I forgot, I resolve with this old plugin:
https://wordpress.org/plugins/widget-output-cache/
Yet is:
https://iili.io/JIzfhw7.jpg
Opening like 50MB database, not 3400MB… Brutal difference. ONLY 4KB script. Pls integrate this cache to LiteSPEEEEEED. 🙂
-
This reply was modified 1 year, 7 months ago by
18TommyBoy.