hut8 / wikiwalk

Shortest path algorithm between pages on Wikipedia
MIT License
3 stars 0 forks source link

Caching: JSON vs. HTML #198

Closed hut8 closed 4 hours ago

hut8 commented 4 hours ago

The /paths/{source_id}/{dest_id} endpoint varies based on content-type. When the browser first requests it (as a direct link) then it's HTML. Then an AJAX request is made which uses Accept with application/json. That is routed to a different endpoint.

When using the back and forward buttons, this ends up displaying JSON to the user if the user goes from the homepage to a results page (after a search), then hits back, then hits forward again.

hut8 commented 4 hours ago

066d4c1