I have some performance heavy SQL queries I can't optimize any further. Since these queries deliver the same results in 99%, I would like to implement some caching.
I found shmop / PHP shared memory to be the only function that is available on almost any webserver. memcache, APC ... are usually not available especially on shared hosting servers.
It generally works great and reduces load significantly. I am aware about the general shared memory security concerns (everybody can read the data) but I won't use it for sensitive information anyway and I will use mcrypt_decrypt on top.
But, how reliable is it in the long term run on different webservers? Can it be recommended for general use at all? Does anyone had negative side effects when using shmop, especially on windows servers?
Thanks a lot.
I think you answered your own question. As a rule, the data is shared and thus not secure. The data can also get lost at any time, so reliable it isn't, again by definition.
If you're looking at improving SQL with 99% the same results, keep in mind that MySQL also has a query cache, so that cache is already working for you, asuming you've configured it correctly.
If you want to do caching in your app, take a look at Redis, especially as a zend_cache backend which supports tagging, allowing you to tag cached values and flush by using a tag.