• Resolved misha5102

    (@misha5102)


    Hello,
    First, I’d like to say that I am a huge fan of Wordfence and use it in all my blogs for both security and caching. I have been using WF for over 6 months and never had any issues… until a friend asked me to help with configuring security in her blog. I obviously installed WF and enabled Falcon caching. Well, everything works fine except for caching the main blog page. Her blog has over 100 posts and pages and all are cached by WF (I enabled debugging data at the bottom of the HTML source) but the main page of the blog doesn’t get cached…
    I was so puzzled that I created a test blog with the same theme and the same set of plugins (all exactly the same versions) and everything (incl. main page) in the test blog was cached just fine.

    Does anybody have any idea what can cause this strange behaviour?

    https://wordpress.org/plugins/wordfence/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Its not a static page is it?

    tim

    Thread Starter misha5102

    (@misha5102)

    No, it’s not.

    Is the site setup with the blog as the homepage? If so, check out my reply on https://wordpress.org/support/topic/falcon-engine-not-caching-homepage?replies=16

    Thread Starter misha5102

    (@misha5102)

    Thanks @kwoodfriend. I looked at the thread you mentioned and there is a high chance that my problem is indeed related to .htaccess and it’s handling by Apache. My friend’s site is a bit tricky, she has a bunch of non-WordPress static pages (incl. homepage index.php) and a WordPress blog installed in a subfolder. As a result, there are two .htaccess files, one in root folder (to control behaviour of static pages) and another on in WP blog folder (this is the one that is used/modified by Wordfence). The blog’s main page is a default page with the list of post excerpts and this page doesn’t get cached. All other WP pages and posts get cached just fine. I mentioned above that I setup a test blog with the same theme/plugins and the test blog is cached without any issues. Well, the difference is that the test blog doesn’t have any static pages, so there is no second .htaccess file…

    @kwoodfriend, in your other post you mentioned that in order to mitigate this problem you modified WordPress’s index.php file and added the logic that mimics the logic Falcon adds to the .htaccess. Can you share your code here, so that I can try to use it to see if it fixes the problem?

    Thread Starter misha5102

    (@misha5102)

    Here are the 2 .htaccess files:

    Blog: http://paste.ie/view/06c99457

    Root (modified for privacy reasons): http://paste.ie/view/29219bd5

    @misha5102 — Do you know what version of Apache the site is using?

    Also, I’m working on an issue with my workaround. The homepage still shows a cached page, even if you’re logged in, which is not the intended behavior. Once I get that fixed, I’ll post the solution I used.

    Thread Starter misha5102

    (@misha5102)

    @kwoodfriend, the Apache version is 2.4.7

    Thread Starter misha5102

    (@misha5102)

    I did more testing and almost confident that @kwoodfriend is correct in his diagnosis – this was broken with Apache upgrade to 2.4. I basically duplicated the site with identical configuration (re WP) on another host and everything works fine there. The difference? Apache version of another host is 2.2.25…

    @misha5102, just any update on the workaround. I should have it ready tomorrow. Just need to tweak a few things to make it generic enough so you can use it!

    Thread Starter misha5102

    (@misha5102)

    @kwoodfriend, any progress with the workaround?

    @misha5102, thanks for the reminder!

    Here’s a gist of what we’re using for the workaround. You will need updated the $targetDomain variable to match your domain. You might also need to tweak lines 24 and 37 to match your setup, since WP is in a subfolder. Let me know how it goes!

    https://gist.github.com/kwoodfriend/079ea35f6f496d053a5f

    Thread Starter misha5102

    (@misha5102)

    @kwoodfriend Thanks a lot! Sorry for the stupid question but where do I insert this code (after changing folders)? Into header.php?

    @misha5102 This should go in the main WordPress index.php file. So, for your friend’s site, it would be blog/index.php (or what ever the subfolder name is for the site).

    Make sure to back up the index.php file first!

    Thread Starter misha5102

    (@misha5102)

    @kwoodfriend, you are a genius! I updated my friend’s blog and everything works fine now, everything is served from cache incl. main blog page. Thanks again.

    [I will mark this topic as resolved]

    Thanks @misha5102! Let me know if you run into issues with it. I’d like to keep the gist updated for any issues.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Bizarre problem with Falcon caching’ is closed to new replies.