Closed chunyenHuang closed 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.
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.
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.
@kevinjcliao removed the local cache and add the vaccine_type
to search params
62
Url parameters for the initial loading
bypass_info=ANY
bypass_info=1
lang=String:Locale
lang=zh
location=String:City
location=臺北市