react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

[Beta] Add support for Back/Forward cache.

Open Avi98 opened this issue 3 years ago • 2 comments
trafficstars

Adding Back/Forward cache(BF cache) support will increase the page restore speed if the user navigates back using browser's back and forward button.

For enabling BF cache we remove unload event listener with pagehide event for more Info. Even after removing this event I'm getting this Error

Screenshot 2022-05-27 at 11 44 10 AM

Avi98 avatar May 27 '22 06:05 Avi98

Not sure what second error you're talking about – if it's the one about the cache control header, that is likely specific to the local development environment. cache-control: public, max-age=0, must-revalidate is the header used on the live site at https://beta.reactjs.org/apis.

sophiebits avatar Jun 03 '22 04:06 sophiebits

@sophiebits thanks for helping me out. Yes for the live site I don't get cache-control header as no-store. But I still have one error: removing the upload event listener. I have removed it from LayoutHome.tsx. But I am still getting this error.

Resource: https://web.dev/bfcache/#never-use-the-unload-event

Screenshot 2022-06-13 at 2 05 13 PM

Avi98 avatar Jun 13 '22 08:06 Avi98