technologies involved • Considerations and planning may be needed • Invalidation strategies… Simple concept of “reusing the data” become complex & complicated matter.
public Cache-Control: no-cache, must-revalidate,max-age=0 • Various technologies ◦ PHP ◦ WordPress ◦ Server setup ◦ Hosting service’s special caching feature • More control • HTTP caching ◦ may be overridden by e.g. CDN • Less control ◦ “communication” is limited to achieve efficient invalidation https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching
custom or 3rd party Page Fragment/Partial Object $var • Fine-grained control • Many small impact • Leverage core caching It is all about selection & combination!
WP Object Cache WP Transients PHP OPcache Does hosting support CDN? Caching mechanism built into PHP, but needs to be enabled at the server level Can be made “persistent” using memory caching added at the server level (e.g. Redis. Memcached.) Settings may be available at the server level to tweak Cache-Control value Does hosting have server level page caching?
◦ To help server level caching mechanism. ◦ Usually to help “communication” • Everything else are usually ◦ Implement its own caching mechanism at the application level Check first with your hosting! Usually falls into these two…
gone “stale”? If yes, stop serving this cache! And delete / purge / flush this cache! • Let’s regenerate this cache! - but when? ◦ Immediately? or ◦ Upon next request? Strategy need to be planed for each different cache
◦ Start with static files, then move onto dynamic… • Page caching ◦ If possible, use server level page caching mechanism ◦ Study what kind of page you can & should not page cache, and when should be invalidated
memory cache, to make WP Object Cache “persistent” • Leverage it in your custom code – with a planned invalidation strategy • WordPress 6.0~ ◦ More utilization of WP Object Cache ◦ WP_Query, WP_Term_Query, WP_User_Query
On or Off – no tweakings neeed • If site has plugins with many files bigger impact • WordPress 6.5 or later? ◦ Improve slow loading of WordPress sites with translations even faster with OPcache? https://make.wordpress.org/core/2023/07/24/i18n-performance-analysis/ https://make.wordpress.org/core/2023/09/05/call-for-testing-performant-translations/ https://wordpress.org/plugins/performant-translations/
icons created by xnimrodx - Flaticon https://www.flaticon.com/free-icons/ram Electronics icons created by xnimrodx - Flaticon https://www.flaticon.com/free-icons/electronics Server icons created by xnimrodx - Flaticon https://www.flaticon.com/free-icons/server