Author Topic: Preventing blocked users to trigger caching?  (Read 583 times)

adegivesmas

  • Newbie
  • *
  • Posts: 4
    • NITA Online
Preventing blocked users to trigger caching?
« on: January 14, 2011, 03:05:58 AM »
Hi - first of all, kudos for AVH FDAS! I've been running it now for over a month, as an "alternative" to Bad Behavior, and it's holding up very nicely - especially when used together with WP HashCash and Akismet.

Question: a few minutes ago I nearly had heart a stoppage, as I visited the front page of my site as a non-logged in visitor (i.e. with a browser without any active session or cookie) and I saw the dreaded "access blocked message" (uh oh) but when I looked at the reported "offender" IP address it was a completely different one! So, I typed the address of the most recent article and lo and behold, that too yielded a blocked message... With another reported IP address. To check, I opened up a different browser that was logged in as admin, and voilà: access was perfectly normal. And of course I checked "my" IP address (via www.whatismyip.com but there are several of those out there) and "of course" my own IP came up. So, I was getting blocked messages for another IP...

That got me thinking. And a few seconds later, I realized it had to be caching: probably, a spammy visitor had triggered the blocked message, and somehow also triggered the caching of a page. Since botnets forge user agents, this isn't too surprising, but it created somewhat of a puzzling message that is presented to all visitors! (The solution here was very simple: clear the caches!)

So here's my question: is there a way that you can think of to communicate with WP caching mechanism (I'm using WP Super Cache but I suppose the standard WP caching method applies) and deny / prohibit caching of the "access blocked" message / page?

In any event: thanks again for the plugin, it's awesome!

Peter

  • Administrator
  • Regular
  • *****
  • Posts: 439
    • http://blog.avirtualhome.com
Re: Preventing blocked users to trigger caching?
« Reply #1 on: January 14, 2011, 01:20:22 PM »
I'll dig into the code and see if that is possible.
Peter van der Does
AVH Plugins developer

adegivesmas

  • Newbie
  • *
  • Posts: 4
    • NITA Online
Re: Preventing blocked users to trigger caching?
« Reply #2 on: January 14, 2011, 02:32:31 PM »
Thanks Peter! I found this in the WP Super Cache developer comments, here:
Quote
Do not cache this page
Define the constant DONOTCACHEPAGE at any time before the current request finishes and the current page won’t be cached.

Peter

  • Administrator
  • Regular
  • *****
  • Posts: 439
    • http://blog.avirtualhome.com
Re: Preventing blocked users to trigger caching?
« Reply #3 on: January 14, 2011, 03:53:37 PM »
Yup I just discovered it myself.
Luckily the same constant is used by another popular caching plugin (W3 Total Cache).

I just added it to the plugin, I'll release an update later today.
Peter van der Does
AVH Plugins developer

adegivesmas

  • Newbie
  • *
  • Posts: 4
    • NITA Online
Re: Preventing blocked users to trigger caching?
« Reply #4 on: January 14, 2011, 03:59:32 PM »
Awesome! Really wonderful, especially that it also works with W3 Total Cache. Thanks again Peter! (Or should I say: "Mijn buitengewone dank voor een fantastische plugin - laat me graag weten of 'n vertaling naar het Spaans interessant is!")

Peter

  • Administrator
  • Regular
  • *****
  • Posts: 439
    • http://blog.avirtualhome.com
Re: Preventing blocked users to trigger caching?
« Reply #5 on: January 14, 2011, 04:43:34 PM »
Currently the plugin isn't set to work with multiple languages. I might introduce this this year.
Peter van der Does
AVH Plugins developer