TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Fast Google Fonts with Cloudflare Workers

43 pointsby cypresover 6 years ago

4 comments

partiallyproover 6 years ago
Couldn't you just download the Google fonts and serve them up yourself and use a Cloudflare rule to cache it on the edge, instead of going through all this work?
评论 #18513910 未加载
评论 #18513707 未加载
WhatsNameover 6 years ago
Maybe it's because I just skimmed the article, but what about the security implications of this? Doesn't dynamically loading third party ressources and serving them under your own domain open a whole can of worms?
评论 #18513651 未加载
评论 #18513669 未加载
chrismellerover 6 years ago
&gt; An alternative would be to keep accumulating data and only process it when there is no split link tag at the end, but this way we can return more data to the browser sooner.<p>&gt; One thing I was initially worried about was having to modify the “content-length” response header from the original response since we are modifying the content. Luckily, the worker takes care of that automatically and it isn’t something you have to implement.<p>If the worker is able to do this for you it’s clearly waiting for all of the incoming data to be processed before it begins sending to the browser, so dealing with the incoming data as chunks is actually needlessly complex.
dtapuskaover 6 years ago
What about caching? The static font files have a really long cache age. You don&#x27;t consider anywhere that the user might already have the font file.