Hi All,
I would like to cache entire pages for users who are not logged in.
If I can check the cache, without running *any* Drupal code, then I get my page execution times down to incredibly short amounts. Less than a millisecond in many cases. This is outstanding.
The problem is, I haven't been able to figure out how to check to see if there is a user currently logged in without running the bootstrap code (and then inspecting $GLOBALS['user']->uid). On my system this takes over 100ms, which is between 2 and 3 orders of magnitude longer than the 0.1ms to 1ms load times I was getting without the bootstrap--a huge increase in execution time. Multiply this by the thousands of concurrent anonymous users our site gets, and the load difference becomes enormous.
I was hoping that I could just inspect $_SESSION (without running any Drupal code) and check to see if there is a currently authenticated user -- but Drupal has custom session handlers, and even after wiring those up, it doesn't look like there's anything in $_SESSION that would tell me who is or is not logged in.
Do I have to run the full bootstrap code in order to be able to tell if there is a user currently logged in?
-Josh