I would point out that it's a _bad_ design to have Zend_Cache_Core make this assertion. This restriction makes it impossible to interoperate the cache with other systems that don't have a similar restriction on ID space. It would be better if this was left to the Backend implementation to validate, potentially via a Backend->_validateIdOrTag(...).

--koblas

Peter Van Dijck wrote:
Hi all,
I am using a caching identifier based on the URL. But I'm getting
strange effects: when accessing a URL I see the cached version of
*another* page.

This is the code I'm using for the cache identifier.

$cache_identifier = ereg_replace("/", "_", $_SERVER['REQUEST_URI']);
$cache_identifier = ereg_replace(".", "_", $_SERVER['REQUEST_URI']);
$cache_identifier = preg_replace("/([^a-zA-Z0-9_-])/", '', $cache_identifier);

I added that last line because I was getting errors saying that the
cache identifier could only have a-z and _- characters.

Any thoughts on how to improve this would be very welcome :)

Thanks!
Peter

Reply via email to