Fresh Blurbs

Extreme Drupal Performance for Authenticated Sites

Cache is an often-used, non-code related fix to performance problems. No matter what kind of cache you use, though (query cache, app cache etc.) you do need a mechanism to repopulate cache once it is invalidated by the system. And you definitely do not want it to be an unfortunate flesh-and-blood user who hit the non-cached page first time, to trigger caching. You'd much rather have a cron do that.

Pretty simple - put a cron in place that hits your site every minute. Job well done.

Yeah, but what if your website is accessed only through authentication? You have to be able to allow cron pass through that, somehow. And here is how:

  1. Add a cron user to the system, with no privileges just authentication and page view ones. Let's name it - cron
  2. Enable "path" module and create a special alias for the home page (or page you need recached). Let's say: "node" -> "cronnode".
  3. Install "securesite" module and secure path "cronnode". This will allow cron to use HTTP Authentication for this path. You need a special path to not disrupt your flesh-n-blood users.
  4. Set up a cron like the following:\

    */1 * * * * /usr/bin/wget -q -O /dev/null --user cron --password cpass


P.S. One more thing: every session opened is logged by both user and securesite modules, so if you mind filling-up your log (probably) with meaningless messages, you may want to do something about it in :

user_login_submit() in modules/user.module
securesite_init() in securesite/securesite.module
comments powered by Disqus