views:

20

answers:

0

I have an ASP .NET site with a custom server-side caching system which is a nightmare. I want to use eTags to replace this.

Many of the links in the site return different versions of a page depending on session state for the user. An example - mypage.aspx?p=a will return different versions of mypage - equally valid, depending on session state. I'd like to cache all versions.

Without totally redesigning the navigation links, how can I do this? From what I've read, putting a different eTag on each as they are generated and served for the first time will just cause the last-generated version to be invalidated and dropped from the cache.

Thanks

PS could I use Response.Cache.VaryByHeaders["Content-Length"] = true and rely on each version being different in length?

PPS Stupid idea! What about adding a custom header with a version key to the response and use VaryByHeaders on that.