-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Ability to import code samples into Sandcastle #3702
Comments
I'm not sure if our experiences with TerriaJS will be much help, but I'll tell you what I know... Our "share" function (go to nationalmap.gov.au, turn on some datasets, and press the Share button) works by encoding the state of the application in the URL. That makes for some giant URLs, so we also use the Google URL Shortener to make them short. But actually we use it in a weird way, so that the web browser never actually sees the long URL. The code is here: Our application uses the API to look up a shortened URL by key, and then decodes that URL and uses the data stored within it. The browser never actually visits the long URL. So in effect, we're just using the URL shortener as a simple data store. In theory we could use any other data store - gists or whatever. I can't really say we did a ton of analysis before choosing the URL shortener versus something else. URLs were politically easier than something like gists, so that was probably the main reason. The Google shortener API also had pretty high free usage limits, so that helped. And when we originally tested it out, there didn't seem to be a practical limit on the length of the pre-shortened URL. However, I think we have now noticed a limit with some of our longer URLs, so test it out for yourself before you go that way. I'd suggest the following desirable characteristics:
|
Here's the code that interprets the expanded URL (without visiting it): |
CC #2152 |
Perhaps using
as discussed offline with @mramato.
Does anyone want to mentor @TomPed on this?
The text was updated successfully, but these errors were encountered: