3

Not sure if I really am on the right forum, but if not, just tell me. I have a page that is coded in Classic ASP which is used to send email. We are currently having a problem in which the page seem to be sent twice sometime. Upon checking, we found out that those who have this problem are coming from big organisation, so it was suggested that their server might cache the file for some reason.

I would like to know, is there a way in HTML (or Classic ASP) to prevent that from happening? Or is it in IIS that we must set this up?

Thanks,

ThatGraemeGuy
  • 15,473
  • 12
  • 53
  • 79
David Brunelle
  • 135
  • 1
  • 7

1 Answers1

3

This is more of a stackoverflow answer, but the following code at the top of your page should do it. This has to be before any HTML is sent to the user or it won't work.

<%
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
%>
MattB
  • 11,194
  • 1
  • 30
  • 36
  • I submited on both in fact, because I wasn't sure it was really programming related Thanks – David Brunelle Mar 26 '10 at 19:11
  • @David: I wouldn't necessarily say it was a truly SO question, because there are probably ways to do it from the server only - just the easiest way is through code. – MattB Mar 26 '10 at 19:29