Skip to content

Commit

Permalink
Clear browser fetch cache (#591)
Browse files Browse the repository at this point in the history
fix: clear browser fetch cache #80
  • Loading branch information
wizardlyhel authored Feb 9, 2022
1 parent b8ebe6f commit c12ec37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/hydrogen/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
- feat: added `useUrl` hook that allows the consumer to get the current url in server or client component
- fix: fix bug where search param is not being pass along during RSC streaming call [#623](https://github.com/Shopify/hydrogen/pull/623)
- feat: expect collection seo by default
- fix: Clear browser fetch cache by @wizardlyhel in #591

## 0.10.1 - 2022-01-26

Expand Down
5 changes: 2 additions & 3 deletions packages/hydrogen/src/framework/Hydration/rsc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,12 @@ export function useServerResponse(state: any) {
);
}

cache.clear();
cache.set(key, response);
return response;
}

export function useRefresh() {
const refreshCache = unstable_useCacheRefresh();
return function refresh(key: string, seededResponse: any) {
refreshCache(createResponseCache, new Map([[key, seededResponse]]));
};
refreshCache();
}

0 comments on commit c12ec37

Please sign in to comment.