Search code examples
phpmemcachedoutput-caching

Can I use Memcache for output caching?


So far, I have only used memcache to cache data (usually the output of an SQL query). Now, I am required to cache output HTML for a few pages of my dynamic site. I will need these pages to be cached for 7 days (even if there is a data change). Is it possible to do it using Memcached ? Are thery any other better alternatives for output caching ?


Solution

  • You can do this with memcache, but it isn't the best method. Some problems are that memcache isn't build for bigger values, it works best with smaller contents. THen you have the problem of it throwing out your values if it needs the space. This could be because it is full, but also because there is no space (slab) for contents of this particular size anymore.

    For something like this I'd suggest you take a look at a caching-solution like varnish