Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Λεωνίδας Μηλώσης - Optimize – optimize – optim...

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

Λεωνίδας Μηλώσης - Optimize – optimize – optimize: Caring for performance of your WordPress plugin or website

Why performance is important and how a WordPress developer can identify and implement quick wins to optimize it. Learn how you can use object cache to improve performance and how to let AI help you with making code faster.

Avatar for WordPress Greek Community

WordPress Greek Community PRO

November 08, 2025
Tweet

More Decks by WordPress Greek Community

Other Decks in Technology

Transcript

  1. Leonidas Milosis Based in Thessaloniki, I'm a plugin developer at

    Yoast with more than a decade of experience in the WordPress ecosystem. I am passionate about backend performance and grateful that I can work on products that reach millions of users world-wide. Plugin developer at Yoast
  2. "Web performance — and its associated best practices—are vital for

    your website visitors to have a good experience." - The Mozilla Foundation - Why? - Good UX https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Performance/why_web_performance
  3. According to Amazon, every 100ms of latency cost Amazon 1%

    of their sales. According to Walmart, speeding up pages by 100ms affects incremental revenue by up to 1%. According to Financial Times, 1-second delay in page speed leads to a 4.6% drop in article views. Better performance = Better conversion rates https://nitropack.io/blog/post/web-performance-matters-case-studies
  4. "Google's core ranking systems look to reward content that provides

    a good page experience." - Google Good UX = Better SEO developers.google.com/search/docs/appearance/page-experience
  5. "We highly recommend site owners achieve good Core Web Vitals

    for success with Search and to ensure a great user experience generally. This, along with other page experience aspects, aligns with what our core ranking systems seek to reward." Good UX = Better SEO https://developers.google.com/search/docs/appearance/core-web-vitals
  6. Core Web Vitals metrics https://developers.google.com/search/docs/appearance/core-web-vitals Largest Contentful Paint (LCP): Measures

    loading performance. Interaction To Next Paint (INP): Measures responsiveness. Cumulative Layout Shift (CLS): Measures visual stability.
  7. Core Web Vitals metrics https://developers.google.com/search/docs/appearance/core-web-vitals Largest Contentful Paint (LCP): Measures

    loading performance. Interaction To Next Paint (INP): Measures responsiveness. Cumulative Layout Shift (CLS): Measures visual stability.
  8. "Good performance is an asset. Bad performance is a liability."

    https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Performance/why_web_performance
  9. Enter WP_Object_Cache developer.wordpress.org/reference/classes/wp_object_cache WP_Object_Cache The WordPress Object Cache is used

    to save trips to the database. It stores all the cache data to memory and makes the cache contents available by using a key, which is used to name and later retrieve the cache contents. By default, the object cache is non-persistent. This means that data stored in the cache resides in memory only and only for the duration of the request. Cached data will not be stored persistently across page loads unless you install a persistent caching plugin.
  10. Persistent Object Cache developer.wordpress.org/reference/classes/wp_object_cache Plugins that you can use: •

    Redis Object Cache provides a persistent backend for the WordPress object cache. A Redis server is required. Or even easier: • Docket Cache uses php’s built-in opcode cache mechanism to provide a persistent object cache. • SQLite Object Cache provides a persistent backend using the SQLite database engine. The SQLite3 extension for PHP is required.
  11. WP_Object_Cache • wp_cache_get( int|string $key, string $group = '', bool

    $force = false, bool $found = null ): mixed|false Retrieves the cache contents from the cache by key and group
  12. WP_Object_Cache • wp_cache_set( int|string $key, mixed $data, string $group =

    '', int $expire ): bool Saves the data to the cache
  13. WP_Object_Cache • wp_cache_delete( int|string $key, string $group = '' ):

    bool Removes the cache contents matching key and group
  14. WP_Object_Cache • wp_cache_flush_group( string $group ): bool Removes all cache

    items in a group, if the object cache implementation supports it
  15. Should I cache that query? When should I? When it's

    computationally expensive (it's on large tables, or it's a nested query, etc.) When it's clear when to invalidate the cache, to avoid serving stale data
  16. Cacheable database operations (are there queries that we can cache?)

    Recurring operations (can we optimize code that runs on every page load?) Where are the quick wins?
  17. Candidate to be optimized Code that compares two arrays to

    see if they are the same Runs frequently If it's not optimized, effects are compounded What if a simple strict comparison is faster?
  18. Cacheable database operations (are there queries that we can cache?)

    Recurring operations (can we optimize code that runs on every page load?) Where are the quick wins?