I have a very simple login page with 1 textbox for username, 1 textbox for password and 1 button for Login.
It is an aspx page and to improve performance I put OutputCache:
<%@ OutputCache Duration="300" VaryByParam="none" %>
However, once I do that my button click only’s fires for 1st time and thereafter no button clicks fire. I think all response is cached. How do I change this behavior such that my button click fires or may be I haven’t understood Asp.Net Caching, may be it should be used only for static pages whose output won’t change?
You answered your question yourself: don’t bother using OutputCache on a login page so you can just cache resources such as images, CSS files, JavaScript files, etc. The proper way to do this is to instruct IIS to cache these types of files by setting appropriate headers.
See here:
https://stackoverflow.com/a/7542816/345490