Current Status: compatible
WP Rocket is one of the easiest caching plugins that can be used together with The Events Calendar.
It allows you to set up exclusions, so you can have the power of caching operating across the whole website without interfering with the way how The Events Calendar works.
Basically, you need to add the address of the plugin assets folder on the Settings page of WP Rocket, and it does all the rest. You can find a list with assets folders in the Plugin folders section below.
Before that, let’s take a look at all the settings that will help us!
File optimization
In your WordPress Dashboard, go to WP Rocket > Settings
. The first tab that we’ll use is File Optimization. There, look for Excluded CSS Files and Excluded Javascript Files
These options will prevent WP Rocket from minifying and combining multiple CSS and JavaScript files into one. Our plugins already serve minified assets, and allowing any external source to re-minify them can lead to undesired behaviors on the calendar pages.
Also, at WP Rocket > Cache, set the Cache Lifespan to be lower than 12 hours to ensure that WordPress NONCE security Keys will work properly. If that number is more than 12 hours, the calendar pagination may not work properly, as it’ll request invalid security keys at some point.
Note: as mentioned on WP Rocket's official documentation, the Cache Lifespan feature will not work on hosting platforms where WP Rocket caching is disabled, such as WP Engine, Kinsta, WordPress.com, etc. So this method won't work, and you'll have to contact your host support. For the full list, check their Hosting Compatibility article.
CDN
WP Rocket also allows you to utilize an external CDN to speed up your asset delivery. This shouldn’t hurt your calendar, but it can generate some differences for logged-in and logged-out users. There are two settings available to help us prevent this.
Here, you’ll use the same folders that you used in the File Optimization tab.
Advanced rules
As a final step, we can ask WP Rocket to never cache the main calendar page.
Here we’re assuming that your kept the default /events/
slug for this page. But if you changed, please use your new slug here.
If you use Community Events, you may consider adding /community-events/
(adjusting for the actual URL used on your site) in the “Specify URLs of pages or posts that should never be cached” box as well.
Plugin folders
Here is a list of the asset folders of each of our plugins that should be ignored.
You can use these values in File Optimization and CDN tabs from WP Rocket settings.
Plugin Name | Assets Folder |
---|---|
The Events Calendar | /wp-content/plugins/the-events-calendar/(.*).css /wp-content/plugins/the-events-calendar/(.*).js |
Events Calendar Pro | /wp-content/plugins/events-calendar-pro/(.*).css /wp-content/plugins/events-calendar-pro/(.*).js |
Events Tickets | /wp-content/plugins/event-tickets/(.*).css /wp-content/plugins/event-tickets/(.*).js |
Events Tickets Plus | /wp-content/plugins/event-tickets-plus/(.*).css /wp-content/plugins/event-tickets-plus/(.*).js |
Filter Bar | /wp-content/plugins/the-events-calendar-filterbar/(.*).css /wp-content/plugins/the-events-calendar-filterbar/(.*).js |
Virtual Events | /wp-content/plugins/events-virtual/(.*).css /wp-content/plugins/events-virtual/(.*).js |
Community Events | /wp-content/plugins/the-events-calendar-community-events/(.*).css /wp-content/plugins/the-events-calendar-community-events/(.*).js |
Community Tickets | /wp-content/plugins/the-events-calendar-community-events-tickets/(.*).css /wp-content/plugins/the-events-calendar-community-events-tickets/(.*).js |
Eventbrite Tickets | /wp-content/plugins/the-events-calendar-eventbrite-tickets/(.*).css /wp-content/plugins/the-events-calendar-eventbrite-tickets/(.*).js |
To copy-paste
You can use the below to copy-paste all CSS and JavaScript asset resources easily.
/wp-content/plugins/the-events-calendar/(.*).css
/wp-content/plugins/events-calendar-pro/(.*).css
/wp-content/plugins/event-tickets/(.*).css
/wp-content/plugins/event-tickets-plus/(.*).css
/wp-content/plugins/the-events-calendar-filterbar/(.*).css
/wp-content/plugins/events-virtual/(.*).css
/wp-content/plugins/the-events-calendar-community-events/(.*).css
/wp-content/plugins/the-events-calendar-community-events-tickets/(.*).css
/wp-content/plugins/the-events-calendar-eventbrite-tickets/(.*).css
/wp-content/plugins/the-events-calendar/(.*).js
/wp-content/plugins/events-calendar-pro/(.*).js
/wp-content/plugins/event-tickets/(.*).js
/wp-content/plugins/event-tickets-plus/(.*).js
/wp-content/plugins/the-events-calendar-filterbar/(.*).js
/wp-content/plugins/events-virtual/(.*).js
/wp-content/plugins/the-events-calendar-community-events/(.*).js
/wp-content/plugins/the-events-calendar-community-events-tickets/(.*).js
/wp-content/plugins/the-events-calendar-eventbrite-tickets/(.*).js