We have a site written in Drupal 6.
We want to use Drupal's caching mechanism to improve performance, but when we turned it on, we found problems because our site has session data displayed on every page. Drupal's caching system only works for static content page, and our session data effectively means that none of our pages are static.
We've come up with two solutions to this:
Rewrite the block that shows the session data such that it loads the non-static data using Ajax, so that the main HTML content is then static. The down-sides of this are that it will mean quite a lot of work, and also that it will reduce functionality for non-Javascript-enabled users and speciality browsers (ie screen-readers).
Move the session data to an
iframe
or similar. This just sounds wrong and I don't want to do it, but it would fix the problem, I think.or find an alternative caching system that will allow us to cache the site in a way that can deal with a there being a small block of dynamic data on every page. This is our preferred option, but we haven't been able to make any progress on finding anything, hence the question here.
So if anyone has any suggestions that would help us with option 3, please let us know. Thank you.
(ps - I know Drupal 7 does have an improved caching system which could help with this, but we're not ready to move to D7 yet)
[EDIT] Haven't made much progress on this, so I'll open it up to a bounty.
I've had a look into how Ubercart deals with a similar situation (since it's one of the most popular Drupal modules and has basically the same problem to solve as we do). They get around it by having the cart info block display static text when the user is not logged in (ie "Click here to view your basket"), and only showing the dynamic cart data on every page when the user is logged in. We don't feel this actually solves the problem; it just evades it, and that's not what we want. But I'm worried that if Ubercart has resorted to doing it this way, it may turn out to be the only option.