Cache busting

Latest addendum plugin:

Introducing Cache Buddy: a companion for your WordPress page caching solution | Mark on WordPress

Cache busting

clear cache, busted

Busted! was the first to do it, but it is now abandoned. For more information, check out WordPress Cache Busting Techniques Done Right and Busted: A WordPress Plugin to Force Cache Busting.

reBusted! is an improved version of the original Busted!, although both are messy in terms of object-oriented programming bloat, and both use four hooks: wp_enqueue_scripts, admin_enqueue_scripts, stylesheet_uri, and locale_stylesheet_uri.

Cachebuster and Cache Buster are functionally identical previous plugins, with both being very clean and utilizing only two hooks: style_loader_src and script_loader_src.

Super Light Cache Buster plugin from the Mwalek/super-light-cache-buster repository ensures that CSS & JS assets have random version numbers to combat browser and page caching, and I like it due to its feature allowing manual cache clearing by changing the “version name”. Refer to the provided screenshot for guidance on how to use the features:

Super Light Cache Buster Dashboard

.The code also deals with attempting to refresh the server cache using the template_redirect hook, as well as the DONOTCACHEPAGE constant that is related to this. Definitely the most mature, but the question remains whether I need all of that. I on za glavnu funkciju koristi hookove style_loader_src and script_loader_src.

Prevent Browser Caching

nginx setting for browser caching of static assets

# Cache static content
# Note: needs a week for A grade
location ~* \.(?:css|js|jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
    expires 1w;
    access_log off;
    add_header Cache-Control "public";

Very simple explanation of browser caching headers.

Ultimativno browser caching je da cache nikada ne expire, a da nako modifikacije menjamo ime asset-a odnsono radimo cache-busting (aka fingerprinting) dodavanjem nekog query stringa. Ovakav proces je objašnjen u članku Your Cache Headers Could Probably be More Aggressive

Cache Buddy by Mark Jaquith offers a unique approach to WordPress plugins. To delve deeper into its features, refer to the article Introducing Cache Buddy: a companion for your WordPress page caching solution by Mark on WordPress.

Purge Server-side cache

cache purge, cache clear

The Cache Purger this plugin attempts to purge all server-side caching methods i meni izgleda vrlo dobro.

Probaj ovaj plugin da napraviš:

AxisSolicitorsLimited/Purge-Cache-WordPress: Purge Cache PHP Snippet WordPress

A ovde je purge Hummingbird cache:

Ako server ne kešira ništa što ima neki query string, alternativa je da menjam ime. Kao što to radi vite.js i ostali build toolovi. Ali to je baš problem. Mogu nekako na nivou plugina, da pravim folder u uploads a zatim u identičnim kao plugin da pravim istu strukturu. Sranje je što moram da iskopiram bukvalno sve assete u istoj strukturi ako se promeni samo jedan asset, što je nebuloza.

Borlabs ima opciju “Clear Third-Party Cache” pa proveri kako je to implementirano, ali definitivno na radi za Raidboxes

date 11. Aug 2016 | modified 13. May 2024
filename: Plugins » Cache » Busting & Clearing