Skip to main content

[Obsolete] Caching GET requests in IE

GET request

The main goal of GET request is to show some data to the user: page, part of the page, control or just data. GET request shouldn’t contain any data changes or any function that leads to changes in the system to be done. Based on that it’s logical to cache GET requests, until page update after another POST request is needed.

IE Caching

 

While working with with AJAX GET requests in IE it becomes obvious, that results are cached in all cases, except the situation, when development tools are opened.
E.g. when user clicks the button “To Basket”, it’s required to refresh basket summary without page reload. It’s easy to reproduce with JQuery function load:
$ (“[container selector]”). load ("[URL]");
This function will replace the content of container with results of URL GET request. and in IE it always will be the same result.

Resolving the issue


Here described two possibilities to resolve the issue:

  1. Switch off cache is most logical operation. In case of using query you can use the function.ajax with the parameter cache set to false, or switch off cache for all JQuery requests 
    $.ajaxSetup ({ cache: false });
    Otherwise add header Cache-control with value no-cache to request.


  2. Add dummy parameter to any request you don’t want to be cached. This solution looks more like hack and not like a real solution, but, unfor
    tunately, there is no parameter to switch off the cache in a single request in.load function. But it’s possible in function .ajax.
$(“[container selector]”).load("[URL]", { dummy: Math.random() });

Comments

Popular posts from this blog

RetrieveMultiple Plugins MS CRM

Plugin for RetrieveMultiple message in MS Dynamics CRM RetrieveMultiple message is not the most popular message in CRM development, because not so much types of tasks are solved via plugin registered on this message. And it leads to situation, when this message is forgotten and not used.

System solutions in MS Dynamics CRM

In storage model description was described, how different types of solutions affect component storage in system. And only one system solution was mentioned: "Active solution", but it's not alone in CRM system. System solutions There are four standard solutions in any CRM organization