We’re trying to reduce server load by running our sites through a load balancer (ZXTM) to serve content as static pages.
We’re running into a problem however on a few sites that must use sessions only. What happens is a logged in user loads a page that has pagination. For some reason that pagination code has the user’s session ID in the link. That pagination code then gets cached by the load balancer and is served to all users.
Another problem is that we have a variety of content we only serve to logged in users like links to “Edit this Entry”. For now we’ve had to disable that code.
This may turn into a feature request to add the ability to send no-cache headers whenever a {member_group} conditional is satisfied.
In the short term however, we’re trying to manually send the following headers only to logged in users.
<?
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-store, no-cache, must-revalidate");
header ("Pragma: no-cache");
?>Ideally we’d put that in a an embeddable template, and call it like so:
{if member_group == "1"}{embed="phpee/no-cache"}{/if}However we’ve been unable to figure out how to get the first snippet of code to work, let alone the second.
I’ve tried adding ‘exit();’, and then the headers will get sent, but none of the content will.
Suggestions?