views:

113

answers:

2

We have a small web farm(2 servers) balanced by the built in network load balancer in Windows 2003. We have a few pages that use page caching. My question is: Is it possible that that a given user could cause a page to be cached and another user see that content? Here is the page directive for the page in question:

<%@ OutputCache Duration="1" NoStore="true" VaryByParam="none" %>

The reason the duration is set to "1" is to ensure that the page isn't cached any longer than 1 second because of transactions that actions on the page can trigger.

A: 

Yes, all users who requested page in particular second will see SAME output.

In asp.net it is better to use OutputCache on controls level, which has same syntax.

You may go with VaryByCustom and make it based on user login or other info. i implemented this for page which was showing location dependendent info.

Also, There is no sense to implement it based on user login/id, because users will not request data few times a second

Sergey Osypchuk
Even with the Duration property set to 1? We are trying to force the page's expiration to occur after each postback to prevent the user from clicking "back" and reposting transactions.
Achilles
'Back' will load page from browser cache in most cases. OutputCache cannot halp you witt this at all.I think you need to play with page headers, where it should be possible to specify expiration date for page, but I am not expert in this
Sergey Osypchuk
A: 

I think instead of caching the page for one second you should look into how to not run transactions when they have been executed.

azamsharp