This Week I Learned: 2022-02-06

  1. I was enthralled by this deep dive into pagination, and wish I’d known the proposed solution of using a covering index and a deferred join to speed up offset/limit pagination at one of my last jobs … Hopefully I find an opportunity to try it out on one of my side projects soon.
  2. Google Analytics, Google Fonts, and a cookie consent popup implementation have all been declared illegal in various European courts recently. The Google Fonts example is particularly interesting as the only PII that Google receives is the IP address – it had never occurred to me that user consent would be needed just to load assets from a CDN, but this ruling suggests that it is.
  3. Speaking of CDNs, I missed the news that Chrome and Firefox both implemented cache partitioning last year. I guess my habit of using a CDN to load JS and CSS libraries on my side projects is now so 2012. I already suspected that my assets weren’t going to be in my users’ cache very often, given how many versions of Bootstrap and jQuery there are floating around on the web, but for a small project it feels like a simpler option than using a package manager or cluttering up the repository with dependencies.
  4. In other Google news, say bye-bye to FLoC and hello to the Topics API. The chief difference here is that once Google knows everywhere you’ve been, they will generate a list of topics that you’re interested in, instead of putting you into a cohort with other people who’ve been to the same places. Or in other words, it’s FLoC but with a predefined list of 300 cohorts. Users will be able to review and change the topics that Google assigns them to as well, which will come in handy next time I google “preg tester” and get inundated with nappy ads.
  5. How !important actually works. Sort of. I understood more about how CSS actually works after watching this video, but then I had to go and find out what cascade layers are. And now I have many thoughts about the fact that a lower-specificity selector in one layer can override a higher-specificity selector in another one. I suppose there must be use cases where this is worth the debugging headache, but until I meet one I think I’ll leave layers alone.