1

Is there a way to effectively handle the cache duration when making Ajax GETs? Please, note that I do NOT want to disable caching. I need to make an Ajax GET to the server and it is wonderful if this can be cached in the browser. However, there are times when content 1 hour old makes no sense so I need to tell: cache: true but for only 1 min. I need this on a per-request URL basis. Having a duration setting per-browser or per-application is not really useful.

What am I missing?

Thanks,

Shiladitya
  • 12,003
  • 15
  • 25
  • 38
Adanay Martín
  • 397
  • 1
  • 3
  • 15

1 Answers1

2

You can follow this strategy:-

Change the Etag every (period of time) in your asp.net MVC backend. Enable the 'cache:true' do look for Etag or last modified in Request Header (if any of change)

For Request headers, someone has written a nice answer, https://stackoverflow.com/a/12501696/713789

Anirudha Gupta
  • 9,073
  • 9
  • 54
  • 79