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

Icon servlet: Set Cache-Control header to enable icon caching #4336

Merged
merged 1 commit into from
Aug 4, 2024

Conversation

florian-h05
Copy link
Contributor

@florian-h05 florian-h05 commented Aug 4, 2024

I have removed the Modified-Since handling as it did not have an effect due to the missing Cache-Control header, and instead added Cache-Control with a max-age set.
This enables "forever" caching of icons, which should be fine since they are static assets - they now have the same caching policy as files in $OPENHAB_CONF/the html folder.

Should be a nice change especially on mobile, where I can often see that icons need some time to load with slow cellular network.

I have removed the Modified-Since handling as it did not have an effect due to the missing Cache-Control header,
and instead added Cache-Control with a max-age set.
This enables "forever" caching of icons, which should be fine since they are static assets.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@florian-h05 florian-h05 requested a review from a team as a code owner August 4, 2024 13:13
Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

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

Thanks!

@J-N-K J-N-K added the enhancement An enhancement or new feature of the Core label Aug 4, 2024
@J-N-K J-N-K added this to the 4.3 milestone Aug 4, 2024
@J-N-K J-N-K merged commit 1ce5b37 into openhab:main Aug 4, 2024
5 checks passed
@florian-h05 florian-h05 deleted the icon-servlet-cachecontrol branch August 4, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants