Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[apiFetch] Fix preloading middleware referencing stale data #25550

Merged
merged 2 commits into from
Sep 24, 2020

Commits on Sep 23, 2020

  1. Reference the preload cache only for the first request

    The logic for preloading middleware in the apiFetch library caches preloaded data. As it stands today, all requests to the preloaded endpoint will reference the cache.
    
    The problem is that the cache is never invalidated during a session. When updates are persisted to the WordPress database, the cache doesn't change, and it will continue to reference the stale, preloaded data.
    
    This fix only allows references to cached data for each preloaded endpoint a single time, after which all subsequent requests to preloaded endpoints will skip preloading middleware.
    jeyip committed Sep 23, 2020
    Configuration menu
    Copy the full SHA
    a570088 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2020

  1. Configuration menu
    Copy the full SHA
    0449a0f View commit details
    Browse the repository at this point in the history