HubSpot/offline

Avoid caching request on image method

nikhilkumar13 opened this issue · 3 comments

I tried to use the image method. It loads an image, which are allowed to cross domains.

But the request is getting cached which is giving wrong result. how to avoid this? I have the application running on local network but the application also requires the internet connection.

You should use like the original implementation, passing datetime with the image. So the image will always be different and it will not be cached.

defaultOptions = {
    checks: {
      image: {
        url: function() {
          return "/yourimage.jpg?_=" + ((new Date()).getTime());
        }
  };

thank you for suggesting this method @arojunior it helps allot

Yup, I used the same trick