I'm trying to write a autotitle-plugin that automatically insert the title-tag into links. Seems to work well, but of course fetching the foreign page and grep the title is something that shouldn't be done every time a page is viewed - a cache is needed.
Is there a standard-cache serendipity(-plugins) may use, a global implementation? I checked the entryproperties-plugin and it seems to me like this is caching using the db, which don't seem too pretty to me. I got a working solution using APC:
Code: Select all
function get_cached_title($url) {
return apc_fetch($url);
}
function cache_title($url, $title) {
return apc_store($url, $title);
} Declaring a class-array as static won't work as persistent cache, will it? So, which way to go?