Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Cache_Lite Alternative

Tags:

php

caching

I'm using Cache_Lite for html and array Cache in my project. I found Cache_Lite may lead to high system IO problem. Maybe because the performance of Cache_Lite is not good

I'm asking is there any stable php html/page cache to use?

I already have APC installed for opcode cache, Memcached installed for common data/array cache.


1 Answers

I've had exact problem with Cache Lite, as library doesn't properly implement file locks.

Solved it with new library and drop in replacement for Cache Lite.

https://github.com/mpapec/simple-cache/blob/master/example_clite1.php https://github.com/mpapec/simple-cache/blob/master/example_clite2.php https://github.com/mpapec/simple-cache/blob/master/example_clite3.php

Just to mention that library lacks some features that I didn't found useful like cache cleaning and caching in memory (_memoryCaching property which is false by default and marked as "beta quality" in original library).

Algorithm which is used for file locking follows this diagram, concurrent read/writes to cache files

like image 181
mpapec Avatar answered Aug 24 '26 22:08

mpapec



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!