Project

General

Profile

Bug #16049

Feature #14877: Donation campaign 2018

Donation banner may be badly displayed because of HTTP caching

Added by geb over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
-
Target version:
Start date:
10/13/2018
Due date:
% Done:

0%

Feature Branch:
web/16049-avoid-cached-local-css
Type of work:
Website
Blueprint:
Starter:
Affected tool:

Description

Hi,

I had a weird rendering while visiting https://tails.boum.org using Firefox today. Instead of the yellow banner of the donation campaign I saw all the texts in <a id="donate-banner"> being printed, without being properly integrated.

I beleive it may be because of some HTTP caching the .css or .js, as it was fixed with a control+r to force content refresh. Unfortunately I did not made a screenshot before trying control+r, but if the website is broken for every users who did already visit the website recently using firefox, it may be interesting to try to fix it, even if the Tor Browser users won't be impacted (as it kept no cache).

:sajolida:

tails-website-banner.png View (808 KB) CyrilBrulebois, 10/13/2018 05:08 PM

History

#1 Updated by geb over 1 year ago

As far as I understand it :

- Some static content is actually pushed to the client HTTP headers allowing one week of caching :

curl -v https://tails.boum.org/local.css > /dev/null
[...]
< Last-Modified: Sat, 13 Oct 2018 01:52:22 GMT
< Cache-Control: max-age=604800
< Expires: Sat, 20 Oct 2018 12:41:10 GMT

- The is no Cache-Control: must-revalidate header
- So the clients may use old version of those files for up to one week, without revalidating them.

Thus
- I am not sure there any way to actually force the clients to refresh stale content, without Control+r
- Adding a Cache-Control: must-revalidate header may help for next updates
- Meanwhile putting the changes in another css file, loading it in the index.html could solve the problem, as there is a max-cache: 0 for index.html, it will always be refreshed.

#2 Updated by CyrilBrulebois over 1 year ago

Thanks for the heads-up. You'll find a screenshot attached, which I've taken with my Firefox that indeed knows about tails.boum.org; opening it in a fresh browser doesn't lead to this issue.

It looks to me the immediate “let's use another CSS file name, that wasn't cached yet” would be a good interim measure indeed.

#3 Updated by geb over 1 year ago

  • Subject changed from Donation banner maybe badly displayed because of HTTP caching to Donation banner may be badly displayed because of HTTP caching

#4 Updated by intrigeri over 1 year ago

  • Assignee set to sajolida

#5 Updated by sajolida over 1 year ago

  • Status changed from New to Confirmed
  • Assignee changed from sajolida to intrigeri
  • QA Check set to Ready for QA
  • Feature Branch set to web/16049-avoid-cached-local-css

Oops, thanks a lot for the heads up!

Here is a commit that we could merged right-now and revert in some days.

I'm assigning to intrigeri who has commit permissions. He also knows more about HTTP caching than me and could check how we could prevent this from happening again once we self-host our website.

If you're happy with my dirty fix and apply it, please reassing this ticket to me so I remember to revert it in a week or so.

#6 Updated by intrigeri over 1 year ago

  • Priority changed from Elevated to High
  • Target version set to Tails_3.10.1

#7 Updated by sajolida over 1 year ago

  • Description updated (diff)

#8 Updated by intrigeri over 1 year ago

sajolida wrote:

Here is a commit that we could merged right-now and revert in some days.

I've amended this commit to update the 2 other places that use local.css. Sadly, the branch (and any other branch forked off master) won't build due to #15936 having been merged into stable, until 3.10 is released, so I'll try to build a branch that locally merges this into stable.

I'm assigning to intrigeri who has commit permissions. He also knows more about HTTP caching than me and could check how we could prevent this from happening again once we self-host our website.

Good idea, added a note about this on #14588 so I don't forget about it.

If you're happy with my dirty fix and apply it, please reassing this ticket to me so I remember to revert it in a week or so.

Will do once I've applied the fix. To be safe, better revert 7+ full days after the new CSS was pushed.

#9 Updated by intrigeri over 1 year ago

  • Status changed from Confirmed to In Progress

#10 Updated by intrigeri over 1 year ago

  • Assignee changed from intrigeri to sajolida
  • QA Check changed from Ready for QA to Dev Needed

Merging! (That will rebuild the full web site, which will take a while.)

#11 Updated by sajolida over 1 year ago

  • Target version changed from Tails_3.10.1 to Tails_3.11

That's right after 3.10.

#12 Updated by sajolida over 1 year ago

  • Status changed from In Progress to Resolved
  • Assignee deleted (sajolida)
  • Parent task set to #14877
  • QA Check deleted (Dev Needed)

I reverted renaming the file in 923165ff09 and I'm pushing now.

In the future we should use Ulrike's URL query technique instead. See 4e30a3e59b.

Also available in: Atom PDF