Cache and optimization: page cache, minify and fonts
The Cache & Optimization tab speeds up public pages without a separate cache plugin. It caches pages, trims the HTML, loads scripts later, handles fonts, and tests the result. Open it in Baza Helper > Cache & Optimization.
Page cache
Turn on Enable public page caching. Only anonymous GET requests without cookies or query parameters are cached. Account, checkout and excluded paths always bypass the cache.
- Cache lifetime (seconds): default one hour, from 60 seconds up to a day. A short lifetime keeps booking data and security tokens fresh, a long one keeps the site fast for every visitor.
- Maximum cached pages: the limit for the stored copies.
- Clear cache when content or theme settings change: keeps visitors from seeing stale pages.
- Excluded URL paths: one path per line, starting with /. A path and everything below it skips the cache.
The tab opens with three cards in this order: Cache management, the Speed advisor, then Page cache and the other settings. In Cache management you see the number of cached pages, the cache size and the expired entries. Clear page cache empties it, and Warm public pages requests up to 100 published pages in small WP-Cron batches so the first visitor gets a cached page. Warmup skips personalized responses. If WP-Cron is disabled on your server, warmup needs a server cron job.
While you are viewing the public site, open the Baza Helper menu in the WordPress admin bar and choose Clear the cache of this page to purge only the current address. Baza Helper removes its saved copy and also asks WP Rocket, W3 Total Cache or LiteSpeed Cache to purge that address when one of those plugins is active.
Use Clear CSS and JS cache when a browser, CDN or interrupted deployment still serves an old combined file. It removes combined CSS and JavaScript files and the generated font-display stylesheet copies, then clears the page cache because cached pages may point to those files. The files are created again from the current sources on the next request. The same command is available in the Baza Helper admin bar.
HTML, CSS and JavaScript
- Conservative HTML minification removes comments and extra whitespace. It keeps inline text spaces, scripts, JSON-LD, styles, SVG, pre and textarea untouched.
- Use compiled minified theme CSS / JavaScript picks the .min file of the theme when there is one.
- Defer compatible theme scripts uses WordPress dependency-aware loading. External provider scripts and booking plugin assets are kept as they are.
- Defer all scripts (jQuery and the theme included) loads every script file after the page is parsed. WordPress keeps the order of scripts that need each other. A script with inline code printed after it, and visitors who are logged in, are left as they are, and if the page runs inline code that calls jQuery by itself, jQuery is kept first. Off by default. Test forms, menus and sliders after turning it on. The setting Scripts kept as they are when deferring all takes one WordPress script handle per line. Those scripts stay in the head and everything else is deferred.
- Combine local stylesheets / scripts into one file works for visitors who are not logged in. Files that load one after another become one file in the same order. Styles with inline code, other media types or @import, and scripts with inline data or modules, stay separate. Test forms, menus and sliders after you turn it on.
- Defer booking calendar scripts appears only when Baza Booking Calendar is installed. Make a test booking after turning it on.
- Defer Elementor and add-on scripts and Do not load jQuery Migrate on the public site remove more blocking requests. Check sliders, counters, menus, popups and forms afterwards.
- Turn off WordPress emoji drops the emoji script and styles. Typed emoji still work because browsers draw them.
- Print small stylesheets inline prints small render-blocking stylesheets inside the page, up to 32 KB each and 64 KB in total. Stylesheets with another media type, @import rules, relative url() and links inside noscript are left alone. Off by default.
Images and the first screen
- Fill missing local image dimensions adds width and height only when both are absent.
- Lazy-load unconfigured images after the first three keeps the first images eager.
- Keep initially visible content static for LCP stops entrance animations from holding back the first screen.
- Preload the largest picture of each page learns from your visitors’ browsers which picture was painted largest and, after two visits agree, adds a high-priority preload for it, separately for phones and larger screens. This picture is never lazy-loaded:
loading="lazy"is removed and the priority is set to high. - Repair accessibility markup automatically gives unnamed links an aria-label, adds a main landmark when the page has none and removes invalid aria-value attributes.
- Replace icon fonts with inline SVG (Elementor) draws Font Awesome and Elementor icons as inline SVG and leaves icon font files out of pages that need no font. See the article Replace Icon Fonts with Inline SVG (Elementor).
Fonts
- Use font-display swap for local stylesheets creates a hashed copy of the CSS with swap added.
- Preload the fonts of local stylesheets automatically preloads the first Latin font file of each @font-face, and Most fonts to preload automatically (1 to 5, default 2) limits how many.
- Preload important font URLs takes up to five WOFF2, WOFF, TTF or OTF addresses. Preload only fonts that are used above the fold.
Critical CSS and deferred styles
The Critical CSS field holds CSS only, with no style tags or imports. It is required before you list Stylesheet handles to load after critical CSS. Unlisted styles stay blocking. The Critical CSS generator can fill the field for you, see its own article.
Direct HTML delivery
Serve HTML directly without WordPress hands cached pages to the web server without starting PHP. It needs page caching and automatic invalidation, and it must pass a real server check first. On Apache and LiteSpeed the button Install the rules automatically backs up .htaccess, writes the rules in front of WordPress’s own, tests the home page, and puts the old file back if anything fails. Remove the rules takes out only the block Baza Helper added. On Nginx the tab shows rules to copy into the server configuration.
Browser cache rules
The browser cache card writes a marked block into .htaccess on Apache or LiteSpeed: one year for images, fonts and video, one month for CSS and JavaScript. On Nginx it shows the lines to copy. It then checks that the server really sends a max-age header. This answers the PageSpeed note “Use efficient cache lifetimes”.
Performance diagnostics
Enter a page address, run the check, or import a Lighthouse JSON report. The result lists problems with the facts and a next step for each, the first own CSS and JavaScript files with their browser cache age, and render-blocking styles. It shows no invented score. The Speed advisor card above it turns the same findings into switches, see the article about the Speed advisor.
Autoplay videos
An autoplay video starts only after the page has loaded, so a heavy looping video does not slow the first screen. On phones the poster image stays until the visitor presses play.
- On Elementor 4.x sites on WordPress 6.9 and later, the plugin turns on the WordPress output buffer for public pages. Elementor turns it off, which stopped the plugin steps and the page cache. The admin, Elementor preview, the customizer and ?preview keep Elementor’s setting. The filter baza_helper_output_buffer (returning false) gives the decision back to Elementor.
- Diagnostic headers: X-Baza-Cache (HIT, MISS or BYPASS), X-Baza-Cache-Reason, X-Baza-Output (buffered or not-buffered, with the reason) and X-Baza-Output-Failure (the last failed step). Check them with a GET request: curl -s -o /dev/null -D – URL | grep -i x-baza. A HEAD request (curl -I) always returns BYPASS with the reason request-method.
- One failed step of page rewriting no longer disables the others. The error is written to the error log and to the option baza_helper_output_failure.
- In the warm-up list the reason “Cache skipped” now names the cause, for example store-failed (version-changed), store-failed (directory), store-failed (entry-limit) or store-filtered.
- When image optimization finishes, the admin bar plays the same soft sound as for new events, if “Sound for new events” is on.
Want a result like this on your site? See our WordPress speed optimization service and ask for a free audit.
