• Resolved p15h

    (@prestonwordsworth)


    Hello Saumya

    I have a couple of queries about how the auto-purge feature works:

    1) Currently, it looks as if both editing and saving in Elementor would trigger a purge, like this:

    [2023-02-15 05:54:58] [cache_controller::purge_cache_on_post_edit] Purge Cloudflare cache for only post id 5450 and related contents – Fired action: elementor/editor/after_save

    [2023-02-15 05:55:00] [cache_controller::purge_cache_on_elementor_ajax_update] Purge Cloudflare cache for only post 5450 – Fired action: elementor/ajax/register_actions

    Would it be possible for the plugin to use only the first hook (https://developers.elementor.com/docs/hooks/php/#action-hooks), ie the ‘after_save’?

    2) Even when ‘Purge cache for related pages only’ is unchecked, simply editing (and not saving) a page in Elementor would still trigger a purge through ‘elementor/ajax/register_actions’. Is this the expected behaviour?

    3) After I set ‘SWCFPC_HOME_PAGE_SHOWS_POSTS’ to false in wp-config and told the plugin not to cache ‘Feeds (is_feed)’, it still regularly preloads /page/2 /page/3 and /feed even though we don’t actually have these pages. Am I using the php constant correctly?

    I would really appreciate your help.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi @prestonwordsworth,
    Let me get into your questions.

    1. I do know about this. Trust me I have already pushed a patch for this but it seems the way WP is calling the function, the static variables are not retaining the value, leading to this issue. There is an alternate approach to this related to using WP transient cache, but it is something I really don’t want to implement due to multiple reasons.
    2. Can you please go to /wp-content/plugins/wp-cloudflare-super-page-cache/libs/cache_controller.class.php and go to line no 227 and comment out the line. Basically, this (https://i.imgur.com/tHSZqAo.jpeg) becomes this (https://i.imgur.com/VI7aD9B.jpeg). The reason I want you to do this is to see if we even need to have this check or can we just remove the check based on Elementor Ajax Update.
    3. If you don’t want to cache the feed you can simply select the option inside the plugin settings under Cache tab. Screenshot: https://i.imgur.com/sJEMqeP.jpeg. You don’t have to do anything else. The SWCFPC_HOME_PAGE_SHOWS_POSTS constant is used for the case when your website home page is showing the latest post. Check the FAQ tab inside the plugin settings. Screenshot: https://i.imgur.com/U6Cw15Z.jpeg.
    4. Coming to preloader, that is a totally different thing and it runs based on the settings you have selected under the Advanced tab. I personally don’t use the preloader and generally don’t recommend using it as it does not give any massive boost considering the server resource it needs to run.
    Thread Starter p15h

    (@prestonwordsworth)

    Thank you very much indeed for your reply.

    2) Commenting the line out sounds just what I was looking for! I’ll report back how it works.

    3) Following your instructions, I checked my ‘don’t cache feed’ option which is selected. And since our home page doesn’t show the latest post, the constant has been duly set to false. What confuses me is the fact that /page/2 /page/3 and /feed still get preloaded anyway whenever the preloader is on, despite these settings. I guess this is a relatively trivial issue, but I wonder if the behaviour means that the preloader is ignoring the ‘don’t cache feed’ setting and the SWCFPC_HOME_PAGE_SHOWS_POSTS constant here?

    • This reply was modified 1 year, 9 months ago by p15h.
    Plugin Contributor iSaumya

    (@isaumya)

    Hi @prestonwordsworth,
    Do test it out and let me know. Yes the preloader preloads those pages if you have selected the last 20 items options. If you select only the menu items or some other things like that I don’t think it will happen.

    Thread Starter p15h

    (@prestonwordsworth)

    Hello again @isaumya

    I can now confirm that commenting out the Elementor Ajax Update line does indeed fix the issue! A purge gets triggered once I hit the save button, and there’s no redundant purges during the editing any more.

    Look forward to the fix being included in a future release, and thanks again for your help!

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @prestonwordsworth,
    Thanks for reporting. I will definitely consider it. The thing is I am just worried that if I remove that call, then it is going to break cache purge for some elementor use case. For example popups and stuffs.

    So, until I get a confirmation that disabling that does not cause any issues with elementor, it is hard to disable it. Can you please thoroughly test the plugin on all possible elementor use case to see if disabling that would cause any issues or not?

    Thread Starter p15h

    (@prestonwordsworth)

    Thanks for this, @isaumya. From studying the log after editing a variety of Elementor components in the past few days including templates and custom fonts (we don’t have a proper pop-up in use at the moment sorry, though I don’t remember it behaving differently back when we did have one), what I’ve observed is a purge always gets triggered in response to ‘Fired action: clean_post_cache’ + ‘Fired action: edit_post’ when a component is saved.

    For more thorough testing, perhaps we could pin a separate post in this forum and ask other Elementor users to weigh in?

    Plugin Contributor iSaumya

    (@isaumya)

    Well I doubt anyone is gonna weigh in. People only weigh in when they have issues.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Bugs with auto-purge?’ is closed to new replies.