But {{$id}} couldn't ever be {{null}} or {{""}}. It's impossible to call {{start('', array())}}, because {{Zend_Cache_Core::validateIdOrTag}} will throw exception {{"Invalid id or tag '$string' : must use only [a-zA-Z0-9]"}}. So, {{$id = $this->_detectId();}} will never be executed, and {{$id = $this->_decodeId($id);}} will produce wrong filename.

Then, in
```
{{$pathName}} become {{"bla-bla/public/cache."}}, and name of file to be created become {{"bla-bla/public/cache./index.html"}}.

So, is it's my mistake or it's really BUG?

Comments

It's important to remember that the static cache doesn't work like the other caches. It's designed to be a transparent backend system triggered from a controller action, and as such, it's entire operation is dictated by the Zend_Controller_Action_Helper_Cache class. About the only thing you should change is the location of the public_dir (you're using a non-path above - use the absolute path).

To offer a few points of difference:

IDs are the request URI, however the ID passed to the backend must first be encoded as hexadecimal characters (i.e. bin2hex()) to bypass the Zend_Cache_Core ID restrictions. The request URI may be empty (root URI) and detectId() simply adds a check to ensure this isn't an error passed along by mistake.

Tags are not stored to the static cache, since the static cache holds files to be served OUTSIDE of PHP. The tags are stored to an "inner" cache instead. The inner cache is managed by the backend, and so tags need to be passed at that point.

Data is never serialized unless it also requires a custom extension name outside of the default option. So setting automatic_serialization, as above, should not be done.

The cache is intended to be managed via the Cache action manager which allows you to setup which actions in a controller to cache, with what extension, and with which tags. It also offers methods for removing/purging the cache using the request URI or tags (the tag cleaning is similar to other backends). Use outside of the action helper should use the helper itself as a reference point for manual management. Manually, you would also need to register a helper/plugin to trigger the Capture frontend.