2

I am using MVC 3. I am opening new tab on button click and in new tab i open one view in which have on iFrame and iFrame load pdf file.

This is work fine but When i open again then it display old file instead of new file. File name is same but file content is changed.

Updated

If pdf file name generate random then its work fine but i don't want to do this.

  • 1
    Probably your server is caching the PDF. You can either indicate to your web server that you don't want to cache PDF files, or you can generate the PDF URL with a "random" parameter appended, like www.domain.com/url?ver=1234 If the value of the parameter is never the same, it won't be cached by the users browser. – nathangiesbrecht Apr 21 '14 at 16:31
  • How to tell server don't caching pdf file? – Rikin Patel Apr 21 '14 at 16:51
1

Your various options are:

  1. Disable browser cache for entire ASP.Net website
  2. Cache Busting on selective URLS
  3. Use a content delivery network that has better handling of expiration on static files
  4. Migrate from MVC to Apache or similar with .htaccess caching
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.