pageshow event in your Webflow Footer Custom Code to detect back navigation via cache and trigger location.reload() when event.persisted is true. sessionStorage on scroll and restore it on load using window.scrollTo().To refresh your Webflow site when users hit the back button while also preserving scroll position, you'll need to handle browser behavior manually, since browsers typically cache pages during back/forward navigation.
pageshow event with event.persisted to detect if the page was restored from the cache.
```
<script>
window.addEventListener('pageshow', function(event) {
if (event.persisted) {
location.reload();
}
});
</script>
```
location.reload() erases that, consider storing scroll position in sessionStorage:sessionStorage.setItem('scrollY', window.scrollY)window.scrollTo(0, sessionStorage.getItem('scrollY'))pageshow-based refresh.
To refresh a Webflow page on back navigation while keeping the scroll position, use the pageshow event to detect cache restoration and trigger a reload. Browsers typically retain scroll position after such a reload, but sessionStorage can be used for added reliability if needed.