g0v / vaccinate

vaxx.tw is a tool to find COVID-19 Vaccine Appointments near you
http://vaxx.tw
MIT License
33 stars 20 forks source link

#62 Use search params for lang and bypass the info modal #103

Closed chunyenHuang closed 3 years ago

chunyenHuang commented 3 years ago

62

Url parameters for the initial loading

Screen Shot 2021-07-26 at 10 11 15 AM
kevinjcliao commented 3 years ago

Understood, @chunyenHuang, can you clarify the first point? Is there any reason why we want to cache this in LocalStorage when all this information can just live in the params? Especially if we're reading searchParams for browser language anyways, I don't see a reason why we need to cache this information.

chunyenHuang commented 3 years ago

It seems to me most of the users visiting the website without parameters, and they may return to the website for more refreshed info in the following days. Caching is a good way to provide the better user experience.

kevinjcliao commented 3 years ago

I see! So the way I understand, I am still in favour of removing all caching for the following reasons: 1) The modal shows important information about the status of vaccination eligibility and who should go to 1922 versus come to vaxx.tw. Instead of caching whether the user has dismissed the modal once, we should figure out a way to cache if the user has seen the particular messages we have put on the modal. This may be complicated. 2) Location: We can ask the user for their location and use that to determine the city to show them vaccination sites for. 3) Language: We already read this from the browser and set appropriately for our user. Caching this introduces another layer of complication in our logic.

Cache invalidation is hard, and so if we're caching something, it'd have to be for a very convincing reason because we'd be introducing state to our user in a way we cannot control server-side. I'm happy to accept a PR without the caching, but I don't think the benefits it introduces outweighs the complexity it adds to our system.

chunyenHuang commented 3 years ago

@kevinjcliao removed the local cache and add the vaccine_type to search params