Implementation of various cache strategies in PHP