Cache problem with files sent to client

  • Thread starter Thread starter Lars Netzel
  • Start date Start date
L

Lars Netzel

Hi

I send a PDF to the client. It's a file with dynamic content but the same
filename and in an old Explorer 5 client it always pull the saem file even
though it should be a new file sent to tjhe client.

The PDF is sent by altering the ContentHeader to PDF mime type in an aspx
page

How do I write code to this page so Explorer will NOT cache this PDF file on
the client?

Best Regards/
Lars
 
Lars,

You can trick the browser into downloading the new file by adding a random
query parameter to the document url, something like myDoc.pdf?12345. You can
use a timestamp to generate the parameter.

Eliyahu
 
Lars said:
Thank you, that seems like agood solution will test that!

An even better solution is using HTTP as it was meant to be...

Response.Cache.SetCacheability(HttpCacheability.NoCache);

Cheers,
 
Back
Top