{"id":1960728,"date":"2024-07-23T00:33:32","date_gmt":"2024-07-23T04:33:32","guid":{"rendered":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/?p=1960728"},"modified":"2024-08-20T11:13:33","modified_gmt":"2024-08-20T15:13:33","slug":"using-the-events-calendar-with-wp-rocket-legacy","status":"publish","type":"post","link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/using-the-events-calendar-with-wp-rocket-legacy\/","title":{"rendered":"WP Rocket"},"content":{"rendered":"\n<p><strong>Current Status:<\/strong> <span class=\"tec-compatibility-status tec-status-incompatible\" style=\"border: none; background-color: #334AFF; text-transform: uppercase; border-radius:28px; padding: 10px 20px; color: #fff; font-size: 14px; font-weight: 600;\">compatible<\/span><\/p>\n\n<p>WP Rocket is one of the easiest caching plugins that can be used together with The Events Calendar.<\/p>\n\n<p>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.<\/p>\n\n<p>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 of assets folders in the <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/using-the-events-calendar-with-wp-rocket\/#Plugin_folders\">Plugin folders<\/a> section below.<\/p>\n\n<p>Before that, let&#8217;s take a look at all the settings that will help us!<\/p>\n\n<h2 class=\"wp-block-heading\" id=\"h-file-optimization\">File optimization<\/h2>\n\n<p>In your WordPress Dashboard, go to <code>WP Rocket &gt; Settings<\/code>. The first tab that we&#8217;ll use is <strong>File Optimization<\/strong>. There, look for Excluded CSS Files and Excluded Javascript Files<\/p>\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/05\/wp-crocket-file-optimization-css.png\" alt=\"WP Rocket settings\" class=\"wp-image-1949697\"\/><figcaption class=\"wp-element-caption\">Look for Excluded CSS Files textarea<\/figcaption><\/figure>\n<\/div>\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/05\/wp-crocket-file-optimization-js.png\" alt=\"WP Rocket settings\" class=\"wp-image-1949698\"\/><figcaption class=\"wp-element-caption\">Look for Excluded JavaScript Files textarea<\/figcaption><\/figure>\n<\/div>\n<\/div>\n\n<p>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.<\/p>\n\n<p>Also, at WP Rocket &gt; 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&#8217;ll request invalid security keys at some point.<\/p>\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"793\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/10\/image-2-1024x793.png\" alt=\"\" class=\"wp-image-1958179\" srcset=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/10\/image-2-1024x793.png 1024w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/10\/image-2-300x232.png 300w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/10\/image-2-768x595.png 768w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/10\/image-2-1536x1189.png 1536w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/10\/image-2-2048x1585.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n<p><code>Note: as mentioned on <a href=\"https:\/\/docs.wp-rocket.me\/article\/975-nonces-and-cache-lifespan#set-cache-lifespan-to-10-hours-or-less\" target=\"_blank\" rel=\"noreferrer noopener\">WP Rocket's official documentation<\/a>, the Cache Lifespan feature will not work on hosting platforms where WP Rocket caching is disabled, such as WP Engine, Kinsta,&nbsp;WordPress.com, etc. So this method won't work, and you'll have to contact your host support. For the full list, check their <a href=\"https:\/\/docs.wp-rocket.me\/article\/670-hosting-compatibility\" target=\"_blank\" rel=\"noreferrer noopener\">Hosting Compatibility<\/a> article.<\/code><\/p>\n\n<h2 class=\"wp-block-heading\" id=\"h-cdn\">CDN<\/h2>\n\n<p>WP Rocket also allows you to utilize an external CDN to speed up your asset delivery. This shouldn&#8217;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.<\/p>\n\n<p>Here, you&#8217;ll use the same folders that you used in the <strong>File Optimization<\/strong> tab.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/05\/wp-rocket-cdn-1.png\" alt=\"WP Rocket CDN settings\" class=\"wp-image-1949702\"\/><figcaption class=\"wp-element-caption\">Exclude files from CDN will have the same content from CSS and JavaScript exclusions<\/figcaption><\/figure><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-advanced-rules\">Advanced rules<\/h2>\n\n<p>As a final step, we can ask WP Rocket to never cache the main calendar page.<br>Here we&#8217;re assuming that your kept the default <code>\/events\/<\/code> slug for this page. But if you changed, please use your new slug here.<\/p>\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2021\/05\/wp-rocket-advanced-rules.png\" alt=\"WP Rocket Advanced Rules settings\" class=\"wp-image-1949707\"\/><figcaption class=\"wp-element-caption\">Never Cache URL(s) should contain the slug of your Main Calendar page.<\/figcaption><\/figure>\n\n<p>If you use <a href=\"https:\/\/theeventscalendar.com\/products\/community-events\/\">Community Events<\/a>, you may consider adding <code>\/community-events\/<\/code> (adjusting for the actual URL used on your site) in the &#8220;Specify URLs of pages or posts that should never be cached&#8221; box as well.<\/p>\n\n<h2 class=\"wp-block-heading\" id=\"plugin-folders\">Plugin folders<\/h2>\n\n<p>Here is a list of the asset folders of each of our plugins that should be ignored.<br>You can use these values in <a href=\"#File_Optimization\"><em>File Optimization<\/em><\/a> and <a href=\"#CDN\"><em>CDN<\/em><\/a> tabs from WP Rocket settings.<\/p>\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Plugin Name<\/th><th>Assets Folder<\/th><\/tr><\/thead><tbody><tr><td>The Events Calendar<\/td><td><code>\/wp-content\/plugins\/the-events-calendar\/(.*).css<\/code><br><code>\/wp-content\/plugins\/the-events-calendar\/(.*).js<\/code><\/td><\/tr><tr><td>Events Calendar Pro<\/td><td><code>\/wp-content\/plugins\/events-calendar-pro\/(.*).css<\/code><br><code>\/wp-content\/plugins\/events-calendar-pro\/(.*).js<\/code><\/td><\/tr><tr><td>Events Tickets<\/td><td><code>\/wp-content\/plugins\/event-tickets\/(.*).css<\/code><br><code>\/wp-content\/plugins\/event-tickets\/(.*).js<\/code><\/td><\/tr><tr><td>Events Tickets Plus<\/td><td><code>\/wp-content\/plugins\/event-tickets-plus\/(.*).css<\/code><br><code>\/wp-content\/plugins\/event-tickets-plus\/(.*).js<\/code><\/td><\/tr><tr><td>Filter Bar<\/td><td><code>\/wp-content\/plugins\/the-events-calendar-filterbar\/(.*).css<\/code><br><code>\/wp-content\/plugins\/the-events-calendar-filterbar\/(.*).js<\/code><\/td><\/tr><tr><td>Virtual Events<\/td><td><code>\/wp-content\/plugins\/events-virtual\/(.*).css<\/code><br><code>\/wp-content\/plugins\/events-virtual\/(.*).js<\/code><\/td><\/tr><tr><td>Community Events<\/td><td><code>\/wp-content\/plugins\/the-events-calendar-community-events\/(.*).css<\/code><br><code>\/wp-content\/plugins\/the-events-calendar-community-events\/(.*).js<\/code><\/td><\/tr><tr><td>Community Tickets<\/td><td><code>\/wp-content\/plugins\/the-events-calendar-community-events-tickets\/(.*).css<\/code><br><code>\/wp-content\/plugins\/the-events-calendar-community-events-tickets\/(.*).js<\/code><\/td><\/tr><tr><td>Eventbrite Tickets<\/td><td><code>\/wp-content\/plugins\/the-events-calendar-eventbrite-tickets\/(.*).css<\/code><br><code>\/wp-content\/plugins\/the-events-calendar-eventbrite-tickets\/(.*).js<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n<h2 class=\"wp-block-heading\">To copy-paste<\/h2>\n\n<p>You can use the below to copy-paste all CSS and JavaScript asset resources easily.<\/p>\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\/wp-content\/plugins\/the-events-calendar\/(.*).css\n\/wp-content\/plugins\/events-calendar-pro\/(.*).css\n\/wp-content\/plugins\/event-tickets\/(.*).css\n\/wp-content\/plugins\/event-tickets-plus\/(.*).css\n\/wp-content\/plugins\/the-events-calendar-filterbar\/(.*).css\n\/wp-content\/plugins\/events-virtual\/(.*).css\n\/wp-content\/plugins\/the-events-calendar-community-events\/(.*).css\n\/wp-content\/plugins\/the-events-calendar-community-events-tickets\/(.*).css\n\/wp-content\/plugins\/the-events-calendar-eventbrite-tickets\/(.*).css\/wp-content\/plugins\/the-events-calendar\/(.*).js\n\/wp-content\/plugins\/events-calendar-pro\/(.*).js\n\/wp-content\/plugins\/event-tickets\/(.*).js\n\/wp-content\/plugins\/event-tickets-plus\/(.*).js\n\/wp-content\/plugins\/the-events-calendar-filterbar\/(.*).js\n\/wp-content\/plugins\/events-virtual\/(.*).js\n\/wp-content\/plugins\/the-events-calendar-community-events\/(.*).js\n\/wp-content\/plugins\/the-events-calendar-community-events-tickets\/(.*).js\n\/wp-content\/plugins\/the-events-calendar-eventbrite-tickets\/(.*).js\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>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&#8230;<\/p>\n","protected":false},"author":46,"featured_media":1955565,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":true,"footnotes":""},"categories":[46],"tags":[19,57],"stellar-product-taxonomy":[152,153,155,156,157,158,159,161,162],"class_list":["post-1960728","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-integrations","tag-caching","tag-performance","stellar-product-taxonomy-community-events","stellar-product-taxonomy-community-tickets","stellar-product-taxonomy-event-tickets","stellar-product-taxonomy-event-tickets-plus","stellar-product-taxonomy-eventbrite-tickets","stellar-product-taxonomy-events-calendar-pro","stellar-product-taxonomy-filter-bar","stellar-product-taxonomy-the-events-calendar","stellar-product-taxonomy-virtual-events"],"acf":[],"taxonomy_info":{"category":[{"value":46,"label":"Integrations"}],"post_tag":[{"value":19,"label":"Caching"},{"value":57,"label":"Performance"}],"stellar-product-taxonomy":[{"value":152,"label":"Community"},{"value":153,"label":"Community Tickets"},{"value":155,"label":"Event Tickets"},{"value":156,"label":"Event Tickets Plus"},{"value":157,"label":"Eventbrite Tickets"},{"value":158,"label":"Events Calendar Pro"},{"value":159,"label":"Filter Bar"},{"value":161,"label":"The Events Calendar"},{"value":162,"label":"Virtual Events"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2023\/02\/social-share-1024x538.png",1024,538,true],"author_info":{"display_name":"Iris Irvin","author_link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/author\/iris\/"},"comment_info":0,"category_info":[{"term_id":46,"name":"Integrations","slug":"integrations","term_group":0,"term_taxonomy_id":46,"taxonomy":"category","description":"","parent":0,"count":115,"filter":"raw","term_order":"0","cat_ID":46,"category_count":115,"category_description":"","cat_name":"Integrations","category_nicename":"integrations","category_parent":0}],"tag_info":[{"term_id":19,"name":"Caching","slug":"caching","term_group":0,"term_taxonomy_id":19,"taxonomy":"post_tag","description":"Learn all about how you can optimize your calendar\u2019s speed and performance with The Events Calendar with these Knowledgebase articles.","parent":0,"count":22,"filter":"raw","term_order":"0"},{"term_id":57,"name":"Performance","slug":"performance","term_group":0,"term_taxonomy_id":57,"taxonomy":"post_tag","description":"Learn all about how you can optimize your calendar's performance with The Events Calendar with these Knowledgebase articles.","parent":0,"count":25,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1960728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/46"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1960728"}],"version-history":[{"count":9,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1960728\/revisions"}],"predecessor-version":[{"id":1962532,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1960728\/revisions\/1962532"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1955565"}],"wp:attachment":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1960728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1960728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1960728"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1960728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}