Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache processing output in memcached. #5

Open
mikemol opened this issue Jan 22, 2012 · 0 comments
Open

Cache processing output in memcached. #5

mikemol opened this issue Jan 22, 2012 · 0 comments

Comments

@mikemol
Copy link
Owner

mikemol commented Jan 22, 2012

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant