📜 ⬆️ ⬇️

We issue tickets when caching

The caching systems that I came across are designed according to the principle: set caching parameters for caching and work with the Cache object. Until a certain time, I was satisfied with this kind of work with a cache. However, time does not stand still and once I needed a more convenient way to work with the cache. As a result, there appeared its own implementation based on tickets. Its essence is that it is necessary to request a ticket from the Cache object, to already set parameters (key, prefix, etc.) from the ticket, and the ticket should be able to save data and retrieve them from the cache.
This solved the problems of conflicts when caching, when someone started working with the Cache object, set some parameters and transferred control to a method that also works with the cache. Now you can exchange tickets.

Implementation for PHP, cache is focused on storing and retrieving data from the file system: code.google.com/p/ewgra/source/browse/#svn/trunk/cache

')

Source: https://habr.com/ru/post/38105/


All Articles