Skip to content

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
Contributor

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
Contributor

@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
Member

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 wled:0_14_1 Nov 17, 2023
softhack007 pushed a commit to MoonModules/WLED-MM 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.

3 participants