Your URL Is Your State

By Ahmad Alfy

Scott Hanselman famously said “URLs are UI”

Think about what URLs give us for free:

Example:

https://prismjs.com/download.html#themes = prism&languages = markup+css+clike+javascript&plugins = line-numbers

URLs are cache keys. Well-designed URLs enable better caching strategies:

If you are not sure if a piece of state belongs in the URL, ask yourself: If someone else clicking this URL, should they see the same state? If so, it belongs in the URL. If not, use a different state management approach.

Jim Nielsen calls these “examples of great URLs”. URLs that explain themselves.

Read here.