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

JSONP callback flexibility for other clients #86

Open
perrygeo opened this issue Feb 14, 2012 · 4 comments
Open

JSONP callback flexibility for other clients #86

perrygeo opened this issue Feb 14, 2012 · 4 comments

Comments

@perrygeo
Copy link

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=

@tmcw
Copy link
Contributor

tmcw commented Feb 14, 2012

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.

@perrygeo
Copy link
Author

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.

@tmcw
Copy link
Contributor

tmcw commented Feb 14, 2012

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.

@springmeyer
Copy link
Contributor

@tmcw - can we close this out? Any more thoughts to provide?

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

No branches or pull requests

3 participants