https://example.com/#!/
https://example.com/#!/about/
https://example.com/#!/users/
Are all the same page as far as the browser concerns, and if you move from `/#!/` to `/#!/users/`, and reload the page, you still load the same page (i.e. `/`).But that was too ugly for URLs, so modern websites now use browser history APIs just so they can remove 3 characters from the URL and do stuff like:
https://example.com/
https://example.com/about/
https://example.com/users/
Sure, if you load `/` and move to `/about/` you don't load a new page because of browser history APIs; but if you then refresh, now you load a different, uncached page (`/about/`, instead of `/`) even if the HTML in the response is exactly the same as in `/`.Sure, the difference is not much, but to me it still seems like a waste when the response could have been cached already like in the first example.
Would back/forward buttons continue to work if we decided not use browser history APIs?
I could try with something like React, but that's too much for a quick test.
.replaceState() will replace current url without putting it in the history, so back won't work, while .pushState() does.
So they invented the history API's so SPA's could stop breaking some of the user expectations they were breaking.
https://developers.google.com/search/blog/2009/10/proposal-f...
If /fred returns HTML, then the URL is perfectly fine, since the only real consumer of fred.md or fred.json are automated systems/API clients, and they couldn't care less what the URL looks like, only that it's predictable.
github.com/[username].png
to get that username's profile picture. github.com/[username].keys
to get their ssh keys github.com/[username].gpg
to get their OpenPGP keys, too!What about any of that is "secret?"
This endpoint does not work.
Well, at least the appending .json to everything.
Together with that, you can also go for putting it in the `hash` part of the URL, if you want to keep it a secret from the server, as the server doesn't receive those parts, `/fred/#format=md`. In this case, it doesn't make much sense, but useful to know for other things, like keys and whatnot.
Server has no need for it.
E.g.
(I’m guessing that also — )Though he was a strict fundamentalist restafarian in other ways he held that this had the benefits of
1. Working
2. Being readily understood
I’ve seen worse ideas. Only downside is that the urls look a bit ugly.