Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Caching / Calls To Cached Map Service Images #942

Closed
bbehling opened this issue Mar 28, 2017 · 2 comments · Fixed by #954
Closed

Disable Caching / Calls To Cached Map Service Images #942

bbehling opened this issue Mar 28, 2017 · 2 comments · Fixed by #954

Comments

@bbehling
Copy link
Contributor

bbehling commented Mar 28, 2017

Seems after the initial load of a dynamic map service, or until the browser's cache is cleared, esri-leaflet is making calls to URLs that look something like -

https://smapservices.ihs.com/wss/service/EMS_1_00/guest/extref_22620fcc-f7aa-4a1e-9a8f-18de3fa8b4aa/_ags_map5b8e4392eb6240bf84cc97439666324e.png

I have to utilize internal map services that are refreshed every 60 minutes and those images are no longer on the server. After 60 mins, requests return a 404 until I clear the browser's cache.

Is there a way to disable this and make requests to the MapServer export end point for every request?
I did came accross this post, but is there a better option than monkey patching?

Perhaps in a future release, there could be a timespan-cache parameter.

EDIT -

Setting the format type to 'image' seems to resolve this problem. Using the default format of 'j', JSON, causes the issues.

What the is the idea behind using JSON as the default response format?

Still would be cool if we could use the cached images on the server for a specified amount of time. I'd be willing to make a request for a timespan-cache param, or possibly contribute.

@bbehling
Copy link
Contributor Author

bbehling commented Mar 28, 2017

Quick followup - seems this also has something to do when using the proxy parameter. If I remove it, we get requests to the map service export end point as expected.

I've worked with the proxy settings in the JSAPI, all that does is append a proxy address to beginning of each map request URL, it does not try to access cached images on the map server. Should this library behave in the same manner?

EDIT - actually, without the proxy, the same thing is happening. I rescind the above comment.

@jgravois
Copy link
Contributor

jgravois commented Mar 28, 2017

Is there a way to disable this and make requests to the MapServer export end point for every request?

it still seems like the best option to add a constructor option which allows folks to disable client side caching by selectively appending a _ts parameter with a timestamp.

is there a better option than monkey patching?

if you can put together a pull request to introduce the feature in esri leaflet core i'd be happy to review it and make sure its landed. if not, i'll get to it myself as soon as i can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants