Agentic UI: Always clear the preview cache when reloading - #4519
Merged
Conversation
Collaborator
📊 Performance Test ResultsComparing 9abcb20 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
sejas
approved these changes
Aug 13, 2026
sejas
left a comment
Member
There was a problem hiding this comment.
Works as expected thanks! Now we'll use hard refresh always minimizing any other issue.
hard-refresh-fixes-301.mp4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
How AI was used in this PR
Claude Code made the change. It's a net deletion of the surface added in #4505.
Proposed Changes
#4505 added a separate "Hard refresh" option so users could shake loose a stale cached redirect. @sejas pointed out that the regular refresh button could just do this in all cases — then there's nothing extra to discover, and it also fixes the everyday annoyance of edited CSS/JS being served stale during development.
Reloading the preview now always drops the HTTP cache. Cost is limited to an explicit user action, and previews are local, so a refresh is cheap. Cookies live in a separate store, so preview logins are unaffected.
One thing had to come along: clearing the cache isn't enough on its own, because a cached redirect moves the webview's current entry onto the other site and
reload()would reload that. Reload now re-navigates to the site's own URL when it detects it's sitting off-origin, and reloads normally otherwise.The dedicated menu item is gone, ⌘⇧R stays as an alias for reload so the browser habit isn't a dead key, and the automatic recovery from #4505 is unchanged.
Trade-off: you can no longer reload the preview with a warm cache, so you can't observe how your site behaves for a returning visitor.
Testing Instructions
body { background: red }to the active theme'sstyle.css).wp-content/mu-plugins/redirect.phpthat 301s its front end to the second's port:curl -sIreturns200with noLocation, then press ⟳ — it returns to the right site.Pre-merge Checklist