Title: Caching breaking site?
Last modified: August 11, 2017

---

# Caching breaking site?

 *  Resolved [maspegren](https://wordpress.org/support/users/maspegren/)
 * (@maspegren)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/caching-breaking-site/)
 * I have no idea how this relates to Wordfence, but when I disabled Wordfence the
   issue went away. When I reenabled, the issue came back. Seemingly randomly a 
   few days ago our site started referencing A.style.css instead of style.css. A
   couple other CSS stylesheets had A. appended to the name as well. Since we don’t
   have a A.style.css, it broke all of our child theme styling (which is what style.
   css referenced). I disabled the plugin and it all came back. Does this make sense
   for Wordfence? I didn’t think there was any caching being done with this plugin,
   but this is weird…

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

 *  [Caleb](https://wordpress.org/support/users/crudhunter/)
 * (@crudhunter)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/caching-breaking-site/#post-9402905)
 * So, here is a dumb, unlikely, but “quick to test” suggestion..
 * If you have the option “Hide WordPress version” switched on in your options page,
   could you try switching it off and retest?
 * That option is not really of any use anymore anyway, so turning it off has no
   negative impact. But it could potentially explain some things.
 *  Thread Starter [maspegren](https://wordpress.org/support/users/maspegren/)
 * (@maspegren)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/caching-breaking-site/#post-9403071)
 * Welp that was a weird thing to try, but it seemed to fix it! Can you explain 
   why that would cause this issue?
 *  [Caleb](https://wordpress.org/support/users/crudhunter/)
 * (@crudhunter)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/caching-breaking-site/#post-9403252)
 * Yes, certainly.. It is a buggy pattern match and change done by WordFence.
    Also
   called “a bug” in the code. 🙂
 * WordFence only touches your CSS and JS links when you turn that option on.
    It
   tries to (only means to) change the “?ver=x.y.z” type parameters on the links,
   but uses a somewhat simplistic preg_match and code pattern to do so. Your site
   must be using some odd links that end up running the pattern astray.
 * Why it affects just YOUR site that way (by mis-matching and changing the wrong
   thing on your particular styling links) I can only say if I knew what your specific
   links look like. Which depends on theme names and other things. Then I could 
   replay that pattern in my head on your link/theme structure, and see where the
   matching and code goes wrong.
 * The problem in your case goes away when you stop trying to “Hide the wordpress
   version”, because WordFence stops trying to change your CSS/JS links. Stops using
   the poorly constructed method to find version strings to change.
 * You don’t need that option anyway.. As it states in WordFence’s own help documentation,
   they actually suggest you no longer turn that option on. There are so many other
   ways for bad guys to know that you are using WordPress that “hiding” is kinda
   useless. 🙂
    And it just adds to the time it takes WordFence to run, without 
   any benefit. Just look at the page source. It is filled with WordPress and plugin
   unique paths. Bad bots don’t care what version of WordPress you are running. 
   Only that you are in fact running WordPress, which is very obvious to anyone 
   looking. All they have to do is ask Google or manually click “view source” on
   a web-page. 🙂
 * BTW.. I was exaggerating when I said “unlikely” to make a difference. 🙂
    Just
   hedging my bets, since I was just making a qualified guess.. 🙂
 *  [mountainguy2](https://wordpress.org/support/users/mountainguy2/)
 * (@mountainguy2)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/caching-breaking-site/#post-9404340)
 * Wow Caleb, that’s an amazing catch on that Wordfence “Hide version” option. That
   explains some CSS problems I had a while back that took me literally days to 
   track down, and never did totally resolve. It sounds good so of course I had 
   it turned on, off now. Thanks, MTN
 *  Thread Starter [maspegren](https://wordpress.org/support/users/maspegren/)
 * (@maspegren)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/caching-breaking-site/#post-9417989)
 * Thank you so much Caleb! After some more research on my site it turns out my 
   issue was a combination of that setting and a PageSpeed mod on the server that
   I was not aware of. Thanks again!
 *  [wfalaa](https://wordpress.org/support/users/wfalaa/)
 * (@wfalaa)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/caching-breaking-site/#post-9418486)
 * Thanks [@maspegren](https://wordpress.org/support/users/maspegren/) for sharing
   the reason for this conflict, did you disable the PageSpeed module as a whole?
   or just re-configured it somehow? I’m curious to know.
 * Good thinking in narrowing down this issue Caleb, thanks!
 *  Thread Starter [maspegren](https://wordpress.org/support/users/maspegren/)
 * (@maspegren)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/caching-breaking-site/#post-9418586)
 * Actually, the mod is still enabled. They cleared the cache and things are looking
   good now. We will be working with the server admin to figure out a way this mod
   stops breaking our site.
 *  [Caleb](https://wordpress.org/support/users/crudhunter/)
 * (@crudhunter)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/caching-breaking-site/#post-9418818)
 * The PageSpeed Mod really do not have anything to do with this particular problem,
   I think, other than it’s caching part holding on to the page content with the
   bad css links in it.
    Meaning that the config change will not be immediately 
   visible, since the page cache has to expire before the new code shows up. Eventually
   the pages would have been expired out the cache by themselves.
 * BTW.. if you don’t like being fronted by PageSpeed, or having it rewrite pages,
   you should be able to turn that off for just your site by putting
 *     ```
       <IfModule pagespeed_module>
           ModPagespeed off
       </IfModule>
       ```
   
 * in your .htaccess file

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

The topic ‘Caching breaking site?’ is closed to new replies.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

## Tags

 * [caching](https://wordpress.org/support/topic-tag/caching/)
 * [child theme](https://wordpress.org/support/topic-tag/child-theme/)
 * [style.css](https://wordpress.org/support/topic-tag/style-css/)

 * 8 replies
 * 4 participants
 * Last reply from: [Caleb](https://wordpress.org/support/users/crudhunter/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/caching-breaking-site/#post-9418818)
 * Status: resolved