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

luci-base: extend Expires directive to prevent caching #6893

Merged
merged 1 commit into from
Feb 17, 2024

Conversation

dhewg
Copy link
Contributor

@dhewg dhewg commented Feb 7, 2024

Some browsers apparently act on fixed dates only, so add that too.
Tested on firefox.

  • This PR is not from my main or master branch 💩, but a separate branch ✅
  • Each commit has a valid ✒️ Signed-off-by: <my@email.address> row (via git commit --signoff)
  • Each commit and PR title has a valid 📝 <package name>: title first line subject for packages
  • Incremented 🆙 any PKG_VERSION in the Makefile
  • Tested on: (architecture, openwrt version, browser) ✅
  • ( Preferred ) Mention: @ the original code author for feedback
  • ( Preferred ) Screenshot or mp4 of changes:
  • ( Optional ) Closes: e.g. openwrt/luci#issue-number
  • ( Optional ) Depends on: e.g. openwrt/packages#pr-number in sister repo
  • Description: (describe the changes proposed in this PR)

@systemcrash
Copy link
Contributor

systemcrash commented Feb 7, 2024

Thank you for this PR.

Is 1980 a specific choice? Because fresh booting a device after a clean install without network (or NTP) typically puts the date at 1970. Choosing a specific date could interfere here in unexpected ways until device syncs time with NTP or browser, and computer realises it is not in 1980. So maybe it makes sense to expire it at some point during the Apollo moon landing :D

@dhewg
Copy link
Contributor Author

dhewg commented Feb 7, 2024 via email

@systemcrash
Copy link
Contributor

I could not find any justification for using exactly that date. POSIX systems start their clocks at 1970, so I figure that's a fair point to use. If it breaks https (after the connection was made to load the page), then it's a sign the date works, surely.

Some browsers apparently act on fixed dates only, so add that too.
Tested on firefox.

Signed-off-by: Andre Heider <a.heider@gmail.com>
@dhewg
Copy link
Contributor Author

dhewg commented Feb 8, 2024

It wasn't meant as a justification. Browers are 50% code and 50% hacks&workarounds to me. So I'd stick to known working values instead of getting eye cancer by researching their code base :D

Anyway, I changed to to 1970/1/1, which seems to works too

@systemcrash
Copy link
Contributor

OK. I'm going to give others some time to comment on this.

@systemcrash systemcrash merged commit 12378d7 into openwrt:master Feb 17, 2024
5 checks passed
@systemcrash
Copy link
Contributor

Good - thanks :)

@dhewg dhewg deleted the expires branch June 7, 2024 04:07
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