Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1324786

    Hello,

    I have a question about excluding a Javascript from Cache. I use WP Rocket and when I write new Posts, the Post will not be shown on News-Overview Pages, on the Homepage its working without clearing the Cache.

    On the Homepage I use the ‘content-slider’ and I excluded: /wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/slideshow/(.*).js

    What JS I have to exclude to show the Posts on the News-Overview Pages without clearing Cache, here I used the ‘blogposts’?

    #1324917

    Hey ronellenfitsch,
    Thank you for the link to your two pages, when I compare the latest posts on the pages both seem the same, please see the screenshot in the Private Content area, from your explanation I was not expecting these to match. But I continued to examine the loaded .js files for each page and found the /news-events/ doesn’t seem to be loading shortcodes.js, so perhaps allowing this to be excluded will help /wp-content/themes/enfold/js/shortcodes.js
    I also notice that it looks like you are using Autoptimize & WP Rocket at the same time, double caching like this could cause issues, so if you continue to have issues please try disabling Autoptimize.

    Best regards,
    Mike

    #1325571

    Hey Mike!

    Thanks for your help and your screenshot.

    You see no diffrence, thats correct, only when new Posts are published. Because if I delete the Cache, everything is good, but I don’t want anytime to delete the Cache when I (or a redakteur) post a News. So when a News is published on the Homepage it’s showing (also without delete Cache) on the other Site it’s not showing without deleting the Cache. And in WP Rocket I excluded the ‘content-slider’ from Cache (for the Home-News-Slider): /wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/slideshow/(.*).js

    It couldn’t be the /shortcodes.js because on the french site it’s active and there is the same. On the german site it’s completly excluded (via asset clean up) and it works anyway without Cache.

    So I think somewehre is another .js like the one for ‘content-slider’ on the Homepage. Is there anything more which is used for the ‘blogposts’.

    Thank you!

    #1325576

    but isn’t there an option to mark that on new posts or comments etc the cache will be refreshed automatically?

    #1325577

    Hey Guenni,

    thank you, but I don’t want to delete the Cache after new Posts are published. Like on the Homepage with ‘content-slider’. On other sites I use ‘blogposts’.

    #1325724

    Hi,
    I believe you will need to refresh the cache when you create new posts, I don’t believe there is a way around that and it is why there is this option in WP Rocket.
    A cache is a “snapshot” of your page at a certain time so the database doesn’t need to be called, by adding a new post you have changed the database but not the cache, so for your cache to show the latest version of your page it needs to be updated.

    Best regards,
    Mike

    #1325751

    Hey Mike,

    thanks for your advice. Your right, I know. But on the Homepage it’s working without clearing the Cache, because I’ve excluded /wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/slideshow/(.*).js in WP Rocket from Cache. Okay, so maybe I will find another way.

    Thank you anyway a lot!

    #1325855

    Hi,
    I can’t explain why excluding slideshow.js would allow content to show without clearing your cache, when I examine the file I only see functions to set the container size and layout, adding the next/previous triggers, and other javascript events, but there are no calls to get the data, so it doesn’t make logical sense why this would work.
    Anyways, did you try /wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/blog/(.*).js for your /news-events/ page?
    The only other way I can think of is to not cache your /news-events/ page at all.

    Best regards,
    Mike

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.