ordercloud-api / ordercloud-javascript-sdk

The official Javascript SDK for the OrderCloud eCommerce platform
MIT License
16 stars 16 forks source link

fix: ie bug caches api responses aggressively #13

Closed crhistianramirez closed 6 years ago

crhistianramirez commented 6 years ago

internet explorer 11 and below will cache any get request that has the same parameters, which can cause unintended consequences

in a client app an order list call was being made to get the most recent unsubmitted order. Some time later, the order was deleted and the same list call was used to get the "next" unsubmitted order. However since the list call was cached, they were getting the wrong order.

added superagent plugin 'superagent-no-cache' which handles this very situtation by checking if request is being made by internet explorer and then setting headers telling internet explorer explicitly to not cache the request