title: PHP - Memcache - HTML Caching
body: <p>I would like to create a caching system that will bypass some mechanisms in order to improve the performance.</p>
  
  <p>I have some examples:</p>
  
  <p>1-) I have a dynamic PHP page that is updated every hour. The page content is same for every user. So in this case I can either:</p>
  
  <p>a) create an HTML page, and that page can be generated every hour. In this case I would like to bypass PHP, so there should be a static page and if the database is updated, a new HTML file will be generated. How can I do this? I can create a crontab script that generates the HTML file, but it does not seem as an elegant way. </p>
  
  <p>b) cache the output in the memory, so the web server will update the content every hour. I guess I need a memory cache module for the web server. There is a unofficial memcache module for lighttpd, but it does not seem stable, I have also heard a memcache module for nginx but don't know whether is this possible or not. This way seems more elegant and possible, but how? Any ideas? (Again, I would like to bypass PHP in this case)</p>
  
  <p>Another example is that I have a dynamic PHP page that is updated every hour, in that page only user details part is fully dynamic (so a user logs in or out and see his/her status in that section)</p>
  
  <p>Again, how can I create a caching system for this page? I think, if I can find a solution for the first example, then I can use AJAX in that part with the same solution. Am I correct?</p>
  
  <p>edit: I guess, I could not make clear. I would like to bypass PHP completely. PHP script will be run once an hour, after that no PHP call will be made. I would like to remove its overhead.</p>
  
  <p>Thanks in advance,</p>