Today I Learned - Rocky Kev

TIL browsers explicity prevent sharing of cached third-party resources

POSTED ON:

TAGS:

The original idea was that you would load resources from a CDN.

For example:

If everybody loads the same jQuery script file (cdn.jquery.com/jquery.latest.js – or whatever URL it was back then), then the script file would be cached by the browsers, and other sites requesting the same script would benefit from the speedup of already cached resources. Users would have popular libraries like jQuery already sitting in their browser cache because earlier visited sites requested them.

But because of privacy, this cross-site resource caching can allow those resources to track users across different sites.

tl;dr:
Both Chrome and Safari have cache keys which prevent tracking, but also leads to duplicated resources in the browser cache. It's a small price to pay for privacy.

Also via this post:

What does this change mean for you? If your sites live on modern hosting that provides a CDN and supports HTTP/2, you can drop the third-parties and should ship all resources yourself. Relying on a third-party provides little value in 2020.

REF:
https://www.stefanjudis.com/notes/say-goodbye-to-resource-caching-across-sites-and-domains/


Related TILs

Tagged:

TIL Content sectioning

Content sectioning or landmarks, like sidebar, content, footer. You know, like better names.

TIL php-fpm

PHP runs as a separated service when using PHP-FPM. By using this PHP version as language interpreter, requests are processed through a TCP/IP socket; so that the Nginx web server only handles the HTTP requests and PHP-FPM interprets the PHP code. The fact of having two separate services is key for increasing efficiency.

TIL Considering Device Obsolescence with web development

I'm incredibly guilty of pushing to build for the latest tech. For good reason too - you can write less code, use more native functions, and things are just more likely to work.