4 ms·
location.replace removes the back button interaction, i.e. history. I have always preferred to use it (location.replace) within the same site. Also it allows t
by xxs 8y ago
location.replace removes the back button interaction, i.e. history.
I have always preferred to use it (location.replace) within the same site. Also it allows to better control browser cache policies.
Although it has been almost a decade since, I doubt much has changed.
- ceejayoz 8y ago> location.replace removes the back button interaction, i.e. history. A 301/302 redirect works just fine for this.
- TeMPOraL 8y agoYup. The RFC is literally full of phrases like "status code indicates that the target resource has been assigned a new permanent URI and any future references to this resource ought to use one of the enclosed URIs. Clients with link-editing capabilities ought to automatically re-link references to the effective request URI to one or more of the new references sent by the server, where possible." (emphasis mine).