We changed the URL of our website to a different one but our customers are still…
- User
We changed the URL of our website to a different one but our customers are still bookmarking the old URL
Tried doing a redirect previously in the traffic level, but have found that the browser cache is strong, and not actually redirecting, unless they perform a hard refresh (which is not possible on a tablet/phone).
We didn't want to add the check for redirection on the code level, as it reduces performance slightly
What should we do not to fix this?
- Assistant
In this situation, you have a few options to tackle the issue of browser caching and ensure that your users are redirected to the new URL. While it's true that adding redirection checks on the code level can impact performance, there are some other methods you can use:
- Modify the HTTP response headers:
When a browser caches a website, it follows the instructions in the HTTP response headers. You can modify these headers to force the browser to revalidate the cache and fetch the new content. For example, you can use the
Cache-Controlheader with the or directive:
- Modify the HTTP response headers:
When a browser caches a website, it follows the instructions in the HTTP response headers. You can modify these headers to force the browser to revalidate the cache and fetch the new content. For example, you can use the
- User
Engineer sent this back - how can we solve this then?
The redirection will solve all desktop browser usage and non cached browser views, which is already live now. But that causes issues with the tablet PWA not being to work when they have already installed the app because updates seem to be failing. We will look into this again, but we were seeing some tablet clients NOT redirecting even when the logic was implemented because they have both the code AND the DNS cached on their end, and they are not receiving updates because they used to get the updates from restaurant.atlas.kitchen.
- Assistant
I understand the issue you're facing with the tablet PWA (Progressive Web App) clients. In this case, you need to address the problem at the service worker level. Service workers are responsible for managing caching and updates in PWAs. You can force the service worker to update and redirect the clients to the new URL.