I cache a dynamic php page with ob_start();. It will cache all the html output from to ; but part of the html output is not static data, e.g., member info came out of $_SESSION by login. How can I skip caching a part of the html? I mean how to keep running the php code within a cached html?
The only way I can imagine is to start ob_start(); from middle of the html.
<html>
<head>
meta data
</head>
<body>
member info (e.g. Welcome USERNAME)
------ start caching from here to the end
ob_start();
.
.
.
</html>
Is it the only way to do so?
One way could be to leave the dynamic part empty in your cache but have a wrapper div e.g.
Now you can fill in the dynamic part using javascript on document load. For example, with jquery,