I enabled output caching in IIS 7 and varied it by all querystrings, using *. However some pages do not act correctly. For instance I have a login page which has a asp:LinkButton which when clicked should log the user in and redirect them. However IIS has cached this page and so all that happens when I click login is the page reloads. What suggestions would you have to avoid this expected behaviour for some pages while preserving it on otheres?
Thanks in advance.
You can’t do this. How output caching works is by caching the rendered html for the page against the specified parameters – in your case, any query string. When you click the link button causing a postback, it is essentially a form post to the same page i.e. same URL, same query string. So the OutputCache module is going to find a match and serve that back, skipping your Page life cycle. The postback, therefore will not be processed.
What you can try is caching only GETs.