ok, so we have thought this over a little bit and propose the following:
- Storage: The HTTP cache will store the HTML in one file and the "meta" in another. The "meta" file would contain our "ban" keys (as a serialized PHP array) for the cached HTML document.
- Invalidation: The application sends a BAN request with a specified HTTP header which contains the ban keys. The response is stored by the cache.
- Checking the cache: On an incoming request we retrieve the HTML and meta files, we check the ban dictionary for the ban keys from the meta file. If the key exists and the request is older than the ban, we forward to the real (application) HttpKernel.
- Ban dictionary: I think it should be sufficient to simply create empty files for each key in the cache directoy. Is there a good reason to use something like Stash for this?
- Cleaning the ban list: We don't, at least not in realtime. Even if we end up with all possible ban keys in the list I guess it shouldn't add significant overhead.