-
Notifications
You must be signed in to change notification settings - Fork 106
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
JSONP callback flexibility for other clients #86
Comments
The main reason for this is that most CDNs (including CloudFront, which we use) strip query strings, so the server never sees the request. Also, dynamic callbacks would consistently break any kind of cache we set up, making things harder to maintain. That said, I think that we support .json vs. .jsonp on hosting and should here as well. A few browsers are able to skip the JSONP hop by using CORS. |
Re: caching dynamic callbacks: We could cache the plain json (which I presume is the expensive part) and just wrap it in a callback dynamically with very little overhead. Of course the default should be the current behavior but it would be a nice configuration option to accept dynamic callbacks (or no callbacks) if you needed the feature on your server. |
Well, yeah - though just hitting the application is very different than allowing content to stay in a CDN. Regardless, there's no real requirement that tilestream needs to behave exactly the same as MapBox Hosting, and this flexibility could be useful. I'll check it out tomorrow. |
@tmcw - can we close this out? Any more thoughts to provide? |
It would be nice to have more flexibility in the jsonp callbacks (as mentioned in #5 and #47). Right now it is hardcoded as grid() and other client implementations may need to a) change the callback function or b) avoid the callback and request straight json.
I understand that, for backwards compatibility, the grid(..) hardcoding is here to stay. But it would be great to have the optional callback query parameter that could allow for dynamic callbacks.
?callback=someOtherFunction
or pure json
?callback=
The text was updated successfully, but these errors were encountered: