Support » Plugin: Super Page Cache for Cloudflare » How not to keep the preview cache

  • When I show a preview of the post, it seems to be left in the cache and not updated.

    Can this be worked around in the plugin settings?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Salvatore Fresta

    (@salvatorefresta)

    Hi @fzoi77 ,
    to avoid this, the plugin uses a cache buster that allow you to see always the fresh page content. It is a query variable appended to all internal links while you are logged in. Its default name is swcfpc=1

    If you don’t see it, there is something wrong. What link do you click to see the preview?

    Can you also paste here the link to your website?

    Thread Starter fzoi77

    (@fzoi77)

    The URL of the preview looked like this.
    https://fmoga.com/airvpn?preview_id=15991&preview_nonce=4dfd4c06ef&preview=true&_thumbnail_id=16071.

    Also, swcfpc=1 is not assigned to the URL of the admin screen, is that because you are bypassing it?

    Blog URL
    https://fmoga.com/

    Plugin Author Salvatore Fresta

    (@salvatorefresta)

    Hi,
    yes this is the reason. Do you see swcfpc for other internal links outside the backend?

    Is this preview link for a custom post type?

    Thread Starter fzoi77

    (@fzoi77)

    Yes custom post type

    For non-administration screens, SWCFPC=1 is granted.
    https://i.imgur.com/DCCdND1.png

    Plugin Author Salvatore Fresta

    (@salvatorefresta)

    Good. Can you please paste here the complete html code of the preview button you click?

    Thread Starter fzoi77

    (@fzoi77)

    I just ran it in a test article.

    The URL in the preview is
    https://fmoga.com/?p=16178&preview=true&swcfpc=1

    It was becoming

    Is that all right with you?
    I’d save the draft and the preview would be updated.

    Plugin Author Salvatore Fresta

    (@salvatorefresta)

    Hi @fzoi77 ,
    as you can see the swcfpc is present on the last link you pasted here. If you open the developer tool on Network tab and click on that link, you should see a cache bypass for the first request (the HTML page).

    If the query variable is not present on the preview link of your custom post type, the reason is the selector. I need to see the HTML code of the link in order to fix.

    For example the HTML code of the preview link for standard posts is:

    <a href="http://example.com/hello-world/?preview=true" target="wp-preview-1" class="components-button editor-post-preview is-secondary">Preview</a>

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How not to keep the preview cache’ is closed to new replies.