Filename based asset cache busting

Filename based asset cache busting

Wordpress plugin

Install on Wordpress

App Details

Filename based cache busting for WordPress scripts/styles using last modified date.

Stop telling clients or users to hard refresh / shift refresh. The url to all of the css/js files on your site will change automatically whenever the files are modified. You can set proper long cache lifetimes to help get top scores on Google Pagespeed without running into cached css/javascript problems.

Based on this gist https://gist.github.com/ocean90/1966227 from Dominik Schilling, I’ve enhanced it by automatically replacing the asset version with the files modification time and automatically editing htaccess – making it install + forget.

Includes querystring option as a fallback – which works in more scenarios.

Webservers

Apache

The plugin should add what it needs to your .htaccess file jsut like WP itself. But if for any reason that doesn’t work for you – here’s what it adds:

# FBACB <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)\.([0-9\.]+)\.(js|css)$ $1.$3 [L] </IfModule> # still fbacb <IfModule mod_expires.c> ExpiresActive on ExpiresByType text/css "access plus 1 year" ExpiresByType application/javascript "access plus 1 year" </IfModule> # END FBACB 

NGINX

 location ~* ^(.+)\.(?:\d+)\.(min.js|min.css|js|css)($|\?.*$) { try_files $uri $1.$2; } 

Host specific notes

Some webhosts need a bit of custom config to get the filename based urls working.

WP Engine

To work on WP-Engine, you’ll need the following redirect added via my.wpengine -> installname -> Redirect rules

 Source: ^(.+)\.([0-9\.]+)\.(js|css)$ Dest: $1.$3 Type: break (this is under advanced) 

CloudWays

Just works.

Flywheel

Just works.

PHP Fallback

If your webserver is failing to serve assets using url rewriting, the plugin attempts to serve them itsef (ie: via PHP). Obviously this is slow/less than ideal in production (it’ll be much slower) – so you should configure your web server correctly to serve the files. If you see this HTTP header “FBACB-Php-Fallback: yes” on your assets, this applies to you.

Note that hosts are increasingly configured to serve css/js directly from disk and won’t fall back to PHP + WordPress error handling – this fallback then won’t work.

Pricing

Starting from $0 per month.

Check Out the Quotes Carousel Widget

By Common Ninja

Quotes CarouselTry For Free!

App Info

Rating

Reviewers

5 reviews

Tags

asset
assets
css
JS
version

Developed By

benlumley

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Quotes Carousel for Wordpress logo

Quotes Carousel

Show inspiring quotes with a quotes carousel that rotates messages, enhances design, and keeps visitors engaged.

Tumblr Feed for Wordpress logo

Tumblr Feed

Show Tumblr posts with a Tumblr feed that keeps content fresh, improves navigation, and helps visitors discover more posts.

Pricing Tables for Wordpress logo

Pricing Tables

Add pricing tables to your site to present plans clearly, help visitors compare features, and guide them toward faster and more confident conversions.

Animated Number Counter for Wordpress logo

Animated Number Counter

Show key stats with an animated number counter that draws attention, adds social proof, and helps increase trust and conversions.

Donation Form for Wordpress logo

Donation Form

Collect and manage donations securely with a customizable online donation form that supports Stripe or PayPal and helps increase contributions.

App Store Reviews for Wordpress logo

App Store Reviews

Show Apple App Store reviews to build trust, strengthen credibility, and help visitors make confident download decisions that support app growth.

QR Code for Wordpress logo

QR Code

Use the QR Code Generator to create and display QR codes for URLs, contact info, downloads, locations, and more.

Google Maps for Wordpress logo

Google Maps

Show business locations clearly with a Google Maps widget that displays multiple points, detailed info, and customizable styles to help visitors find you easily.

LinkedIn Feed Slider for Wordpress logo

LinkedIn Feed Slider

Show LinkedIn posts with a slider that auto updates, presents content in a smooth layout, and keeps visitors engaged.

Email Subscription Form for Wordpress logo

Email Subscription Form

Capture email leads with an email subscription form that collects addresses, saves entries, sends notifications, and helps grow your audience.

Announcements for Wordpress logo

Announcements

Add announcements to your site to share important updates, keep visitors informed, and guide them toward actions that support engagement and conversions.

Tabs for Wordpress logo

Tabs

Use tabs to organize content into clear sections, improve navigation, and help visitors switch between topics quickly for a smoother user experience.

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms