At the top of the page:
<% pStr = "private, no-cache, must-revalidate" Response.ExpiresAbsolute = #2000-01-01# Response.AddHeader "pragma", "no-cache" Response.AddHeader "cache-control", pStr %> |
Note that if you mix this technique with Response.BinaryWrite, the download might fail. Remove the last AddHeader line above in combination with techniques like that described in
Article #2161.
No love? If you find that you're still getting the old page, after clearing your browser's page and even deleting the file from the server, then IIS has it cached. You can clear this by going into the IIS Admin interface and unchecking "Cache ISAPI Applications", hitting apply, uploading the new file, and turning the setting back on. You can also do this by issuing an
iisreset call or unloading your application, at the cost of interrupted service. If you are using IIS 6.0, you might consider reading these articles on MSDN, to learn more about how caching ISAPI extensions works in IIS, and how you can control it programmatically (instead of handling it like above, in every page):
ISAPI Extension Architecture ISAPI Extension Overview CacheISAPI