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

Fix settings caching on some browsers #3508

Merged
merged 3 commits into from
Nov 17, 2023

Conversation

Moustachauve
Copy link
Contributor

Some browser, especially Android webview, have more aggressive caching strategies and might sometimes cache the response of the settings JS.

This implements two strategy, one in the back-end and one in the front-end. Two might be overkill, so we could keep a single one if needed.

Front-end strategy to prevent caching

By adding a random string to the path of the js file every time, we make sure to never hit the browser cache.

Back-end strategy to prevent caching

By setting the response header "Cache-Control" to "no-store" and setting "Expires" to 0, we make sure the browsers and place calling this never store it in cache.

By adding a random string to the path of the js file every time, we make sure to never hit the browser cache.
By setting the response header "Cache-Control" to "no-store" and setting "Expires" to 0, we make sure the browsers and place calling this never store it in cache.
@blazoncek
Copy link
Collaborator

I would only approve the second even though we may never have exact control over browser caching on a particular Android/iOS/PC device.
Also, please use 0_14_1 or 0_15 branch for PR.

@softhack007 softhack007 added this to the 0.14.2 candidate milestone Nov 11, 2023
@blazoncek
Copy link
Collaborator

@Moustachauve can you revert HTML changes and only do backend change?
That way I think we can merge it right away.
@softhack007 do you agree?

@Moustachauve
Copy link
Contributor Author

Unless @softhack007 has a strong opinion, I will revert the HTML changes tonight.

@softhack007
Copy link
Collaborator

softhack007 commented Nov 16, 2023

@Moustachauve can you revert HTML changes and only do backend change?
That way I think we can merge it right away.
@softhack007 do you agree?

Fine for me 👍

@Moustachauve Moustachauve changed the base branch from main to 0_14_1 November 17, 2023 02:21
@Moustachauve
Copy link
Contributor Author

Revert for the html changes is done.

@blazoncek blazoncek merged commit a83d9a0 into Aircoookie:0_14_1 Nov 17, 2023
12 checks passed
softhack007 pushed a commit to MoonModules/WLED that referenced this pull request Nov 27, 2023
@Moustachauve Moustachauve deleted the fix-settings-cache branch February 7, 2024 16:14
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.

None yet

3 participants