Technology

Caching Problem with AJAX Request

Problem Scenario:

  • Subsequent AJAX request to server is not getting the new data.
  • Code on the server is not being executed after the first request.

Solution:
The simplest way to resolve all the above issues is by making every request to the server a new and unique request. This way every time you or client issues a request it won’t be cached since it is a unique request every-time.

Now, you might think how to make subsequent requests unique when what you are actually doing is re-using the same request, the answer is very simple. You can append a unique data every-time to the request. Simplest way to achieve that would be just append a time-stamp to the request (pass it as a parameter).

Popularity: 1% [?]

Discussion

No comments for “Caching Problem with AJAX Request”

Ads by Google

On Facebook

Bawaal on Facebook