Learn about Centmin Mod LEMP Stack today
Register Now

Wordpress Creating the fastest possible Wordpress Site

Discussion in 'Blogs & CMS usage' started by JMX, Aug 6, 2024.

  1. JMX

    JMX New Member

    10
    1
    3
    Mar 5, 2022
    Ratings:
    +6
    Local Time:
    4:15 PM
    10
    Introduction
    I've been using WordPress for over 15 years, beginning with shared hosting, moving to my own server about eight years ago, and finally switching to managed hosting (currently using Cloudways) two years ago. This change was prompted by a lack of time to create client websites manually. I'm not an IT guy, I'm have a marketing/seo background. Now I left the client business and have 5 own websites I try to find the best solution for.

    What Makes a Site Fast?
    To ensure a site is fast, we need to focus on three key components:
    1. Quick Delivery: The site and all its components (CSS, images) must reach the user quickly.
    2. Small Size and Fast Rendering: The site must be lightweight, and its components should render quickly.
    3. Efficient Loading: Components should only load once to maximize efficiency.

    How? To ensure the first point is definitely the job of a server and a CDN.
    The second point is the job of optimizing WordPress, writing clean code (read as: Not Elementor or Divi) and being reasonable with images (plus preloading). Plus: Designing a site so that it is cashable very well.
    And last but not least, BEM best practices and CSS that is cached in browser.


    Strategies and Questions

    1. Quick Delivery of Site Components
    • DNS Speed: Utilize a fast and decentralized DNS provider, such as Cloudflare, to ensure quick name resolution.
    • CDN Caching: If the page is static in nature, it has to be fully cached. Not only that, but it has to be cached in proximity to the end-user. Again, I have chosen Cloudflare, but there are many valid alternatives for that. To my understanding, Cloudflare APO does exactly that.
    • Long TTLs on all levels, because we are using an intelligent component (Wordpress) that (in theory) should be intelligent enough to tell a cache if it changes a page/post/whatever.... right?
    • Server Performance: The server has to compute everything that is not static (WP-Admin for example, or form submissions) really fast. QUESTION: I see no use for a full-page-cache on server level. Everything that would be able to be full-page-cached should be cached close to a user and not on the server, is that correct?
    • So what can we do to even make nginx faster in replying to a request?
      - We can cache database queries
      - We can cache php-stuff (I told you, I'm no IT guy)
      QUESTION: Would https://objectcache.pro/ be the right tool for that? Does it cache database as well as php-objects?

    2. Optimized Website Size and Fast Rendering
    This might be the hardest to do (because eva2000 made the server part somewhat easy for us).
    • Script Management: Use tools like Perfmatters to remove unnecessary scripts, implement preloading, and optimize overall performance.
    • Clean Code: Utilize frameworks like Bricks and Automatic CSS to ensure the codebase is efficient and maintainable.
    • Images: Images are an area where I still haven't found what I'm looking for. Minifying images and serving them as WebP is the first and easy step. QUESTION: But I'm looking for a tool that analyzes my rendered page and breakpoints and crops the images to exactly the right pixel size. I know that WordPress can generate smaller images at upload. But wouldn't it be far better if I upload only the original, and a plugin then looks at the website where it was rendered and generates the optimum maximum size for each breakpoint? Is there a tool/plugin like that?

    • This area need further exploration. TBC

    3. Components should only load once
    This is the easiest of all (I think). Utilize browser-cache for everything. I still haven't explored this field in depth, though. QUESTION: Can I archive the following - with what rule? Cache everything for a year. CSS, Images, files you can just keep for a year because they are versioned (..?v=1.86 etc.). With HTML, I also want to cache it in the browser, but after the page is already rendered the browser should ask the cache: "I have this version, is this still good?" and if not, the browser invalidates the cached version and gets a fresh one next time.


    TLDR;
    I'm a noob regarding most of the topics mentioned. Please help me find flaws in my understanding of the topic. Here are questions:
    1. I see no use for a full-page-cache on server level. Everything that would be able to be full-page-cached should be cached close to a user and not on the server, is that correct?
    2. Would https://objectcache.pro/ be the right tool for that? Does it cache database as well as php-objects?
    3. But I'm looking for a tool that analyzes my rendered page and breakpoints and crops the images to exactly the right pixel size. I know that WordPress can generate smaller images at upload. But wouldn't it be far better if I upload only the original, and a plugin then looks at the website where it was rendered and generates the optimum maximum size for each breakpoint? Is there a tool/plugin like that?

    Also, is all that the right approach? I'm very happy for all your thoughts on that!
     
  2. eva2000

    eva2000 Administrator Staff Member

    53,142
    12,108
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,643
    Local Time:
    12:15 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yes CDN level full page caching would be faster than server level full page caching though you can have both if your web site can leverage that i.e. static content sites. For dynamic member based sites with logins, you can't do that so need for whatever full page caching you use to be able to differentiate between the 2. For example read my Cloudflare CDN TTFB Optimization guide I wrote on their support forums and my outlined 3 segments to optimize at https://community.cloudflare.com/t/improving-time-to-first-byte-ttfb-with-cloudflare/390367/

    Free Redis Object Workpress cache plugin should suffice it helping off load MySQL database query based load to Redis.

    If you have 100% control over images uploaded, you don't really anything other than optimizing images you uploaded. If you have users uploading images, then you may need a plugin to auto optimize user uploaded images
     
  3. victor

    victor New Member

    14
    0
    1
    Apr 9, 2015
    Slovenia
    Ratings:
    +3
    Local Time:
    5:15 PM
    MariaDB 10
    Maybe you should consider the following stack:
    Wordpress -> Graphql - > Astro CMS (latest version supports Island Architecture)