• Resolved generosus

    (@generosus)


    Good Day,

    PageSpeed Insights was updated recently. The update is now flagging a Wordfence file under the following performance parameter: “Serve static assets with an efficient cache policy”

    Details: https://prnt.sc/R2fuaqXIPGz8

    We are bypassing the caching of noted file (URL), but the issue is still being flagged by PageSpeed Insights.

    Your review, assessment, and fix for this condition is appreciated.

    Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter generosus

    (@generosus)

    Update:

    It appears the message is sporadic. Sometimes the WF file is flagged, sometimes it’s not.

    Can you run some PageSpeed tests with some of your customers’ websites to see if you can reproduce the same?

    Thank you!

    Plugin Support wfpeter

    (@wfpeter)

    Hi @generosus, thank-you for sending that info over.

    The team have taken a look and it seems the site is caching this?request when it shouldn’t be. The wordfence_lh calls might be configurable to ignore from your site’s caching settings.

    In this example, PageSpeed thinks?wordfence_lh?is retrieving a resource that should be cached, which is incorrect.

    Thanks,
    Peter.

    Thread Starter generosus

    (@generosus)

    Thanks, Peter. Great info.

    Solution:

    Following our previous message, we immediately performed the following:

    1. Speed Optimizer Plugin: We added the following URL to be excluded from caching: /?wordfence*
    2. Cloudflare: We created a new Cache Rule as noted here.

    The above solved our issue. Hopefully, this will help others.

    Cheers ??

    Thread Starter generosus

    (@generosus)

    Update:

    Well, the issue is back. The above solution is not working. Yes, all checks performed.

    Perhaps Team Wordfence can contact Team PageSpeed (via GitHub) to ensure they add an exclusion for the above file path.

    Thank you!

    Thread Starter generosus

    (@generosus)

    Update:

    Issue fixed. Again, we used the solution posted above except we changed the Cloudflare rule operator from “equals” to “contains“, cleared cached, then waited 1 hour for the change to propagate to the edge.

    Cheers ??

    Thread Starter generosus

    (@generosus)

    Minor Correction:

    These are the Cache Rules we used. Cloudflare’s Cache Rules engine no longer accepts Wild Cards (*).

    Cheers ??

    Thread Starter generosus

    (@generosus)

    Optional Solution: (Best)

    Add the following rule to your .htaccess file, then flush all cache:

    <If "%{THE_REQUEST} =~ m#/?wordfence_lh=1&hid=#">
    	<IfModule mod_headers.c>
    	Header set Cache-Control "private"
    </IfModule>
    </If>

    Cheers ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘PageSpeed Insights Flagging Wordfence’ is closed to new replies.