• Resolved loukky

    (@loukky)


    i have install wp-statistics,i found “WP Cloudflare Super Page Cache” will cache wp-statistics,how to fix it?

    • This topic was modified 5 years, 3 months ago by loukky.
Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi @loukky,
    WP Statistics is something that shows up on the admin side and admin side are never cached so, I don’t see a reason why WP Statistics will be cached. The whole wp-admin side is not cached.

    Thread Starter loukky

    (@loukky)

    maybe the reason is that i set wp-statistics cache mode.I will keep watching

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @loukky,
    Can you share a screenshot of the issue? Cause again as I said the admin side of WordPress is never cached and WP Statistics shows up on the admin side. So, no chance for that page to be cached.

    Thread Starter loukky

    (@loukky)

    infact now i the disable wp cloudflare super page cache…so the screenshots look dont have any issue,but i type the issus on screenshots.
    here are screenshots:
    https://imgur.loukky.com/imgs/2021/02/d0634c27e06dddac.png
    https://imgur.loukky.com/imgs/2021/02/0febc23e66f804bc.png

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @loukky,
    I see what you mean. And it is funny that you mention that as today only I opened a core track ticket about it which you can find here: https://core.trac.ww.wp.xz.cn/ticket/52636

    Maybe you can also chime in here and explain why WordPress should include a proper cache-control header for the wp-json REST API endpoints. Now it is up to the WP core team to either add no-cache cache-control for wp-json endpoints or give users an option to add that for those who need that.

    BTW are you on an nginx server or apace or lightspeed server? Can you let me know that?

    Thread Starter loukky

    (@loukky)

    My website are running on Apache server.And i have read your core ticket,but i am sorry i cant help you,my English is very poor…

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @loukky,
    Are you using Apache 2.4.x? If so we add this code in htaccess which is supposed to work:

    
    <IfModule mod_headers.c>
        <If "%{THE_REQUEST} =~ m#\s/+wp-json/?[?\s]#">
        Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
        </If>
    </IfModule>
    

    Can you verify 2 things:
    1. Are you using Apache 2.4?
    2. Do you see the above htaccess rule in your htaccess file?

    Thread Starter loukky

    (@loukky)

    2.4.46 this is my Apache version,and i dont see these rules in .htaccess file.
    so i need to type these rules to .htaccess file?

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @loukky,
    No need. Inside the plugin settings click on “Disable Page Cache” and then once the page reload, click on “Enable Page Cache” that should add that rule. Let me know if that works.

    Thread Starter loukky

    (@loukky)

    now i have enable wp cloudflare page super cache,i found wp-Statistics is still cached by cloudflare,i think i know,but i dont know how to expression because of my poor English,you access my website and i think you can know why….
    my blog:https://loukky.com

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @loukky,
    Just tell me that do you see the above htaccess file in your htaccess file now?

    Thread Starter loukky

    (@loukky)

    Yes i do

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @loukky,
    Can you now comment/remove that code and replace it with:

    <IfModule mod_expires.c>
    ExpiresActive on
    ExpiresByType application/json "access plus 0 seconds"
    </IfModule>

    After you do that purge your whole Cloudflare cache. Let me know once done.

    • This reply was modified 5 years, 3 months ago by iSaumya.
    Thread Starter loukky

    (@loukky)

    Done,this url will not cache now…

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @loukky,
    Yes this is the easiest possible hack which is only possible in apache/lightspeed servers to force not caching of wp-json until WordPress core team adds a way to have prove cache-control header for rest API endpoints.

    So, test now and let me know. Things should work now.

Viewing 15 replies - 1 through 15 (of 19 total)

The topic ‘it will cache wp-statistics’ is closed to new replies.