[openstreetmap/openstreetmap-website] Viewing a changeset loses context of previous changeset list (#647)

Anton Khorev notifications at github.com
Sat Nov 26 13:46:02 UTC 2022


> with the url changing to a working permalink (instead of trying to save state in cookies or local storage etc).

This is a strange statement. That "save state in local storage" (actually in session storage in my case) is done to cache the page fragment and it's not a replacement for url rewriting. You do both url rewriting and caching, and this is what Turbo does as well, I assume. Turbo doesn't need to store things in local/session storage for this purpose because you're supposed to have the majority of pages working without full reloads. In this case you can store fragments by cloning their dom elements or just copying html to some javascript variable.

I can do the same thing here and it would be simpler code except the osm website is far from being able to work without full page reloads. The cache would persist only as long as the user stays on router.js-controlled pages, the ones that have a map displayed. For example if you're on a changeset list page and you click a changeset link, the changeset list would still be cached and you could go back to the list without reloading everything. But if you click a user link, the cache would be gone.

The approach above is better than no caching at all, but I still need utility functions like https://github.com/openstreetmap/openstreetmap-website/pull/3773 to implement it.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/647#issuecomment-1328049429
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/647/1328049429 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20221126/eea828b8/attachment.htm>


More information about the rails-dev mailing list