Skip to content

Fix : BFCache issue in Interactivity Router#75853

Closed
Vrishabhsk wants to merge 1 commit intoWordPress:trunkfrom
Vrishabhsk:fix/interactivity-router-bfcache
Closed

Fix : BFCache issue in Interactivity Router#75853
Vrishabhsk wants to merge 1 commit intoWordPress:trunkfrom
Vrishabhsk:fix/interactivity-router-bfcache

Conversation

@Vrishabhsk
Copy link
Copy Markdown
Contributor

What?

Why?

  • When a reload action happens after going through the pagination of a query loop, navigating backwards or forwards renders the same cached page regardless of the URL.
  • Expected behaviour is for the correct page in the pagination to render

How?

  • Removed the prefetch call made in the navigate action

Testing Instructions

  • Generate many posts, i.e. wp post generate.
  • Create/edit a template to display posts with pagination via the core/query block. Ensure Full page reload is off.
  • Go to the page that uses said template.
  • Click the next page pagination link a couple of times.
  • Reload the page.
  • Hit the back browser button.
  • Notice how the list of blog posts has updated.

Preview of the fix followed by the actual issue

fix.mp4

@github-actions github-actions bot added the [Package] Interactivity Router /packages/interactivity-router label Feb 24, 2026
@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Vrishabhsk <vrishabhsk@git.wordpress.org>
Co-authored-by: nani-samireddy <nanisamireddy@git.wordpress.org>
Co-authored-by: wongjn <wongjn@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@im3dabasia im3dabasia added [Type] Bug An existing feature does not function as intended [Feature] Interactivity API API to add frontend interactivity to blocks. labels Feb 24, 2026
@luisherranz luisherranz requested a review from DAreRodz February 24, 2026 11:34
@DAreRodz
Copy link
Copy Markdown
Contributor

👋 Hi, @Vrishabhsk, thanks for the PR! The actions.prefetch() call in navigate() is required, though; some of the e2e tests were failing with that change.

I created #75927, which supersedes this one. You also appear there as a contributor. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Interactivity API API to add frontend interactivity to blocks. [Package] Interactivity Router /packages/interactivity-router [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Interactivity Router does not update content with back/forward after reload

3 participants