Skip to content

Implement Back/Forward Cache functionality with configuration options…#5

Merged
rhoerr merged 5 commits intomage-os:mainfrom
JaJuMa:bfcache
Sep 17, 2025
Merged

Implement Back/Forward Cache functionality with configuration options…#5
rhoerr merged 5 commits intomage-os:mainfrom
JaJuMa:bfcache

Conversation

@JaJuMa
Copy link
Contributor

@JaJuMa JaJuMa commented Sep 5, 2025

Implemented browser back/forward cache (BFCache) to make page navigation faster when users hit the back/forward buttons.

Key Features

Smart mini cart updates - Choose between immediate refresh or wait for user interaction
Auto-close menus - Automatically closes open mobile/desktop menus when returning from cache
Admin controls - Full configuration through System Configuration
URL exclusions - Skip BFCache for specific pages that shouldn't be cached

@JaJuMa JaJuMa mentioned this pull request Sep 5, 2025
@rhoerr
Copy link
Contributor

rhoerr commented Sep 16, 2025

Thank you Oli and JaJuMa team. I'll be reviewing.

Are you open to Davide incorporating the VCL aspect from #2?

Copy link
Contributor

@rhoerr rhoerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review. Pardon the nitpicking. Mostly minor formatting. Only major concern that I have is the use of regex.

@JaJuMa
Copy link
Contributor Author

JaJuMa commented Sep 16, 2025

Thank you Oli and JaJuMa team. I'll be reviewing.

Are you open to Davide incorporating the VCL aspect from #2?

We are open to adding this feature, but we believe it’s important to consider the implications carefully. Automatically generating a new VCL file for Varnish configuration could potentially cause confusion or conflicts with any existing VCL customizations that users may already have in place.

Perhaps we could consider adding a configuration note or mechanism to specify exactly which lines should be added and where, rather than generating a full new file. This way, we can help users integrate the changes safely into their existing setup.

Let’s discuss the best approach to ensure flexibility and avoid any unintended side effects for users with custom VCL configurations.

@rhoerr
Copy link
Contributor

rhoerr commented Sep 16, 2025

Excellent. Thank you for the quick turnaround. I made a small change to the Http config load method for type safety (unlikely getValue would return a non-string, but just in case). Otherwise, looks good.

I would like to test it before merging. I will try to do that tonight.

We can continue the discussion on how to handle VCL in #2.

Copy link
Contributor

@rhoerr rhoerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@rhoerr rhoerr merged commit 5157b41 into mage-os:main Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants