Fórumok

Extending CacheFilter to use data from a cookie as part of the key

Ruben Martin Pozo, módosítva 11 év-val korábban

Extending CacheFilter to use data from a cookie as part of the key

New Member Bejegyzések: 6 Csatlakozás dátuma: 2012.12.07. Legújabb bejegyzések
We need to extend the CacheFilter to use data that comes in a cookie as part of the page's cache key. I guess we could use an extension but we're not allowed to use them in our production environment. We've thought about using a filter to wrap the request and append the data we need to the queryString so the cache filter use it to compound the page's cache key. What do you think of this approach? Do you see any problems that might arise later on?

When the queryString is null we could return just the data in the cookie as if this information had come from the browser. Again, do you see any problems here?

We like this approach but we aren't sure if this hack would be totally safe.

Thanks.