• Hi,
    I’ve run into a serious issue with WP-Optimize’s Browser Cache feature that causes wp-admin pages to be cached by the browser, which leads to existing posts being overwritten instead of new posts being created.

    Important:
    This behaviour has only started happening recently, despite the Browser Cache feature having been enabled for a long time without issues. Something appears to have changed (perhaps browser behaviour or how the headers are applied).What’s Happening

    When Browser Cache is enabled, WP-Optimize inserts this rule into .htaccess:

    <filesMatch "\.(x?html?|php)$"> Header set Cache-Control "private, must-revalidate, max-age=2592000" </filesMatch>

    Along with ExpiresByType text/html "access 1 month".

    This effectively instructs browsers to cache all PHP output, including admin pages, for up to 30 days.

    As a result:

    • “Add New Post” may load a cached version of post-new.php
    • That cached page contains the previous post’s post_ID
    • Publishing then overwrites the earlier post

    This is reproducible across major browsers.How to Reproduce

    1. Enable Browser Cache in WP-Optimize.
    2. Create Post A.
    3. Click “Add New” → browser may reuse cached page.
    4. Create Post B → Post A gets overwritten.

    Disabling cache in browser dev tools prevents the issue.Workarounds

    • Disable Browser Cache in WP-Optimize (resolves it), or
    • Modify the PHP rule to:

    Header set Cache-Control "private, must-revalidate, max-age=0"

    This stops wp-admin caching while keeping static asset caching.Why This Is Serious

    • wp-admin content must never be browser-cached.
    • Long-term caching of PHP is unsafe for dynamic sites.
    • This results in silent data loss, which is particularly severe.

    Suggestion

    Browser Cache should:

    • Exclude .php, or
    • Exclude /wp-admin/, or
    • Apply only to static assets (CSS, JS, images).

    Given that this issue has only surfaced recently, it would be useful to review whether browser behaviour or plugin logic has changed.

    Happy to provide further info if needed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support jbgupdraft

    (@jbgupdraft)

    Hi,

    Thanks so much for reporting this and providing steps to reproduce. I will test this on some of my sites and see if I can experience the same behaviour.

    One quick question, can you let me know which version of WP-Optimize you are using? We had a release earlier today so I just want to double check.

    Thank you!

    Thread Starter digikb

    (@digikb)

    Hi,

    We are using Version 4.4.0, the latest version, but we also experienced this on the previous version too.

    Also, we have replicated this issue on multiple websites.

    Look forward to hearing back.

    Many thanks

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.