I have a non-modifiable function that takes a few seconds. The function returns an array of objects. The result changes only once a day.
To speed things up, I wanted to cache the result using APC, but the hosting provider (shared hosting environment) does not offer any memory caching solutions (APC, memcache, ...).
The only solution I found was to use serialize () to store the data in a file and then deserialize the data back.
How about generating php source code from an array? Later I could just call
require data.php
to get data into a predefined variable.
Thanks!
UPDATE: saving the resulting .html is not an option, because the output is user dependent.
source share