News for hackers. Stuff that matters.
Re:I took a job at Amazon, only to leave after 10 months by kentonv on Wednesday January 05, 2022 @02:30PM (#29813726)
Please consider increasing the contrast on your text. As is (light-gray-on-lighter-gray) I cannot read it as it literally hurts my eyes trying to focus on it.

EDIT: It seems this is not intentional, some of the stylesheets are returning 404 for me but not other people... weird.

EDIT: Amazingly, it turns out this site is hosted on the platform of which I'm the lead engineer (Cloudflare Workers / Pages) and the problem is in fact our own fault, not Ben's. Wow. We'll... get on that. Sorry.

FINAL EDIT (hopefully): Not necessarily a bug so much as classic cache skew... explanation here: https://news.ycombinator.com/item?id=29814868

Re:I took a job at Amazon, only to leave after 10 months by coldpie on Wednesday January 05, 2022 @02:42PM (#29813875)
A browsing tip: In Firefox, you can right-click on low-contrast text, select 'Inspect (Q)', and a thing will pop up showing all of the attributes of the text. You can uncheck the 'color' styles to restore a good text color, the filter at the top of the list helps find the 'color' entries. For some reason everyone loves grey-on-grey these days, so I find I'm doing this a lot.

I've been thinking of writing a Firefox extension to auto-detect the page background color and set the text color to the polar opposite of that. Haven't done it yet, but I'm getting close.

Re:I took a job at Amazon, only to leave after 10 months by 6DM on Wednesday January 05, 2022 @04:02PM (#29814886)
I'll do you one better, just use reader mode. It's the document looking icon in the url bar to the left of the bookmark button.
Re:I took a job at Amazon, only to leave after 10 months by mgkimsal on Wednesday January 05, 2022 @06:00PM (#29816411)
reader mode often gets past many 'subscribe to continue reading' overlays.
Re:I took a job at Amazon, only to leave after 10 months by effingwewt on Thursday January 06, 2022 @12:43AM (#29819919)
Is also my go-to to avoid clicking either 'accept all' or 'click here to read 10 pages of dark patterns to maybe disallow a few trackers' cookie modals.
Re:I took a job at Amazon, only to leave after 10 months by justemre on Thursday January 06, 2022 @12:01PM (#29826151)
There is an addon for this actually. Adjust colors for your own pleasure and press F2 (or whatever you want). https://addons.mozilla.org/en-US/firefox/addon/dark-backgrou...
Re:I took a job at Amazon, only to leave after 10 months by coldpie on Thursday January 06, 2022 @04:17PM (#29830319)
Thanks, this looks great. I'll give it a shot!
Re:I took a job at Amazon, only to leave after 10 months by benadam11 on Wednesday January 05, 2022 @02:43PM (#29813883)
Just pushed an update - btw Cloudflare pages are fantastic its been perfection for a personal site.
Re:I took a job at Amazon, only to leave after 10 months by kentonv on Wednesday January 05, 2022 @02:57PM (#29814081)
Hmm I don't see any change yet but LOL if the 404s turn out to be my own fault due to a Workers bug. :)
Re:I took a job at Amazon, only to leave after 10 months by benadam11 on Wednesday January 05, 2022 @03:07PM (#29814227)
https://3be909f6.personal-site-v4.pages.dev/ has the updated styles but the change doesnt seem to have propagated to domain yet (made the background pure white instead of grey)
Re:I took a job at Amazon, only to leave after 10 months by kentonv on Wednesday January 05, 2022 @03:14PM (#29814306)
Yeah that page looks much better, not just the colors but also the headings and paragraphs are now formatted correctly.

Crazily enough, it looks like the missing files are actually a problem on our (Cloudflare's) end. We're looking into it. But a re-deploy should fix it for now, I think.

Re:I took a job at Amazon, only to leave after 10 months by kentonv on Wednesday January 05, 2022 @03:34PM (#29814553)
Hey Ben, we think your re-deploy solved the problem, but the old content is still being served from Cloudflare's cache for many people. Can you do a cache purge in the Cloudflare dashboard?

(It just updated for me, looks much better. But the old version might still be cached in some locations.)

The root cause was actually something we fixed last month, but it seems problems can stick around if the site was originally deployed before that fix... we're working on that.

Re:I took a job at Amazon, only to leave after 10 months by kentonv on Wednesday January 05, 2022 @04:00PM (#29814868)
On further investigation we think this might have been purely a caching issue, not the backend problem we originally suspected.

The problem is that your site generator produces different file names for each version, but doesn't preserve the old files. So when you upload a new version, then the old version of the assets become 404, unless they happened to be cached. But it's possible the HTML is cached and the CSS not cached, in which case people will get the old HTML which refers to a CSS file that is now 404.

This is a classic problem and we need to find a better way to solve it. In principle, though, you could manually avoid it by preserving older versions of the CSS such that they continue to be served under new versions of the site.

Alternatively, if you change the config on your domain so that it doesn't cache at all (or at least turn off the "cache everything" option), and instead rely on Cloudflare Pages itself to manage caching, that also should mostly* avoid the problem. Pages does do its own caching, so adding a second layer of caching on top of that shouldn't be necessary.

* There's still a problem if someone is unlucky enough to load the site exactly when it's being updated, but at least a refresh fixes that. We need a better answer, though...

Re:I took a job at Amazon, only to leave after 10 months by denysvitali on Wednesday January 05, 2022 @05:05PM (#29815695)
Wow. Thanks for the explanation and for being humble in considering it (partially) your mistake.

I have to admit it was quite a plot twist, but this is why I love HN: we're both users and developers at the same time!

Re:I took a job at Amazon, only to leave after 10 months by benadam11 on Wednesday January 05, 2022 @04:36PM (#29815313)
Thanks for following up! Looks like that setting was on from an old version of the site. Probably not a super common thing for people who are onboarding to CF Pages (previously my origin was on AWS) and I migrated to Pages.
Re:I took a job at Amazon, only to leave after 10 months by aghilmort on Thursday January 06, 2022 @01:04AM (#29820032)
seconded -- great read / info also as user of Cloudflare Pages for multiple domains
Re:I took a job at Amazon, only to leave after 10 months by SergeAx on Thursday January 06, 2022 @02:41AM (#29820560)
Isn't that a default behavior for modern JavaScript SPAs: bundle all the frontend code into several files with unique hash names and refer them from generic html home page? Changing hash every time code changes?
Re:I took a job at Amazon, only to leave after 10 months by geelen on Sunday January 09, 2022 @06:23PM (#29868525)
Yes, which is why Pages has some dedicated logic to help preserve assets that were "seen in the last version now gone". Unfortunately, the "cache everything" setting at the CDN overrides that. We should probably be clearer about that in the docs, and potentially we could autodetect that setting when you register your custom domain, hmmm...
Re:I took a job at Amazon, only to leave after 10 months by souldeux on Wednesday January 05, 2022 @04:51PM (#29815522)
interesting read, thanks for sharing this
Re:I took a job at Amazon, only to leave after 10 months by zzleeper on Wednesday January 05, 2022 @04:14PM (#29815020)
I'm curious, how do they compare against S3? (cheaper, easier to use, ...?)
Re:I took a job at Amazon, only to leave after 10 months by benadam11 on Wednesday January 05, 2022 @04:39PM (#29815344)
I had my site fronted with CF previously w/ an origin on S3 and it cost about $0.53/mo (super cheap). CF Pages current pricing is free for unlimited bandwidth which is pretty incredible - https://pages.cloudflare.com/#pricing
Re:I took a job at Amazon, only to leave after 10 months by dymk on Wednesday January 05, 2022 @02:32PM (#29813747)
The page presents as an almost pure black background, and almost 100% white text to me - about as high-contrast as you can get. Maybe this is a light/dark mode issue?
Re:I took a job at Amazon, only to leave after 10 months by ollien on Wednesday January 05, 2022 @02:33PM (#29813757)
Yeah - on my phone it's WoB but on my desktop (which is dark mode) it's BoW
Re:I took a job at Amazon, only to leave after 10 months by jacobsenscott on Wednesday January 05, 2022 @02:35PM (#29813787)
I think it is because the font is so thin it looks gray, even if the thin lines are made up of 100% white pixels. FireFox reader mode makes it readable though.
Re:I took a job at Amazon, only to leave after 10 months by kentonv on Wednesday January 05, 2022 @02:35PM (#29813780)
I don't have dark mode enabled. What I see seems to be the default style, and is consistent across multiple browsers for me.
Re:I took a job at Amazon, only to leave after 10 months by dymk on Wednesday January 05, 2022 @02:36PM (#29813793)
Very interesting. This is what I see - https://i.imgur.com/eV4yDd0.png
Re:I took a job at Amazon, only to leave after 10 months by kentonv on Wednesday January 05, 2022 @02:40PM (#29813840)
Huh! It's more than just colors, you have padding between paragraphs whereas I don't. I think the page must not be loading correctly? I do see these two stylesheets returning 404:

https://benadam.me/assets/prisma-dark.19c66771.css

https://benadam.me/assets/work.b7de8a03.css

Re:I took a job at Amazon, only to leave after 10 months by dymk on Wednesday January 05, 2022 @02:44PM (#29813897)
The padding for the paragraphs is indeed coming from prisma-dark.css - that would explain it!
Re:I took a job at Amazon, only to leave after 10 months by ajkjk on Wednesday January 05, 2022 @02:46PM (#29813922)
This is what I see: https://imgur.com/dN7nPOS . Almost unreadable after a few minutes, it's so faint.
Re:I took a job at Amazon, only to leave after 10 months by pc86 on Wednesday January 05, 2022 @02:45PM (#29813919)
This is almost exactly what I see on Edge 64-bit 96.0.1054.62, Windows 10 19042.1415
Re:I took a job at Amazon, only to leave after 10 months by kiddico on Wednesday January 05, 2022 @03:52PM (#29814777)
It's a surprisingly small world we've created
Re:I took a job at Amazon, only to leave after 10 months by rPlayer6554 on Wednesday January 05, 2022 @04:40PM (#29815363)
This kind of thing is why I love to be on HN. It's so interesting to be able to discuss technologies with the people that created them.
Re:I took a job at Amazon, only to leave after 10 months by benadam11 on Wednesday January 05, 2022 @02:39PM (#29813836)
- it has an 8+ contrast ratio so I thought it would be ok (also been mostly working in dark mode) - will update. Thanks for your feedback.
Re:I took a job at Amazon, only to leave after 10 months by kentonv on Wednesday January 05, 2022 @02:43PM (#29813884)
I think some of the stylesheets are not loading correctly, I get 404 on these:

https://benadam.me/assets/prisma-dark.19c66771.css

https://benadam.me/assets/work.b7de8a03.css

Re:I took a job at Amazon, only to leave after 10 months by tyingq on Wednesday January 05, 2022 @02:35PM (#29813779)
The weight was the problem for me. document.body.style.fontWeight=600 in the console made it readable.

It also has <p> styled with a zero margin, which makes things hard to read as well.

Re:I took a job at Amazon, only to leave after 10 months by joegahona on Wednesday January 05, 2022 @03:09PM (#29814253)
This page is almost unreadable for me too -- a giant oil-spill of light gray text on a white background with no discernible headers, no spaces between paragraphs, etc. Brave, desktop, Version 1.33.106 Chromium: 96.0.4664.110 (Official Build) (arm64)
Re:I took a job at Amazon, only to leave after 10 months by acdha on Thursday January 06, 2022 @10:55AM (#29825149)
As a Cloudflare customer, I really like that you were comfortable just taking responsibility and jumping on it. That’s a healthy sign in an engineering group.
Re:I took a job at Amazon, only to leave after 10 months by ordiel on Thursday January 06, 2022 @01:07AM (#29820052)
This is slightly similar to that moment when checking code and ask who is the dumb ass who wrote a certain piece just for git blame to show your name...
Re:I took a job at Amazon, only to leave after 10 months by winternett on Wednesday January 05, 2022 @03:10PM (#29814270)
This happens with so many sites now... UI and 508 compliance seem to be going out the window lately... Almost thought I was goin blind. :(