mikemol/mwgeshiglue — Issue #5: Cache processing output in memcached.
Author: mikemol
Created: 2012-01-22 05:59:23+00:00
State: open

Running GeSHi on several hundred different language snippets for the same page is very expensive. It would be very worthwhile to take the results of the processing of a particular snippet and store it in memcached.

The cache key would consist of a configured prefix (to build a private namespace in memcached's key table), the md5() of the code snippet and the sha1() of the code snippet. This should be sufficiently unique that accidental collision of hashes would be nearly impossible in the lifetime of the site, and intentional collision would be very, very difficult.

The glue code should compute the cache key and retrieve and return the key value if available. If the key value isn't available, it should process the code and store the result using that cache key.