Live data from Hacker News

ETag and HTTP Caching

rednafi.com

11–20 of 92 posts

Re: ETag and HTTP Caching

#11
An approach like https://github.com/benbjohnson/hashfs allows file names to be updated at runtime to be content hashed. This removes the need for the extra "304 Not Modified" API calls from the client. This content hash based file renaming is usually done using a build step which renames files. For applications where the static file serving and HTTP request processing are done in the same application, this can be done in memory without a build step for file renames.

I am using that approach in my project https://github.com/claceio/clace. It removes the need for a build step while making aggressive static file caching possible.

Re: ETag and HTTP Caching

#12

[flagged]

I’m not saying you’re a GPT4-based bot, but I want to point out this comment really triggered my LLM radar

I was under the impression that LLMs don't generate grammatical errors often if at all, so "what they needs to know" caught my attention. It did trigger my"empty praise" vacuous spam detector though.

Re: ETag and HTTP Caching

#14
post #11

An approach like https://github.com/benbjohnson/hashfs allows file names to be updated at runtime to be content hashed. This removes the need for the extra "304 Not Modified" API calls from the client. This content hash based file renaming is usually done using a build step which renames files. For applications where the static file serving and HTTP request processing are done in the same application, this can be don…

I use content hashes for some of the images in parts of my site. And I use the IPFS scheme for it, and have the path be under /ipfs/ or some such.

And so you could find the same file on IPFS if anyone served it there, as the content hash in the url tells you what to look for.

Even though on my side I’ve done this all completely manually, so much so that it’s literally just me calculating the IPFS hash on my machine one time and then having symlinks with those content hashes so that /ipfs/ directory on my sites contains content that is served by their IPFS content hash, even though my server does not run an IPFS node or anything.

A very interesting side effect of this is that one time I loaded one of my pages, the web browser actually picked up on the pattern and offered to load those files over actual IPFS!

Re: ETag and HTTP Caching

#15

[flagged]

It really delves into the topic, would you say?

In the blog post that was shared in this Hacker News post they explore themes such as ETag, and leverage diagrams and examples to present a dynamic presentation that elevates understanding for the reader in a compelling manner.

Re: ETag and HTTP Caching

#16

Earlier quoted context omitted.

It really delves into the topic, would you say?

In the blog post that was shared in this Hacker News post they explore themes such as ETag, and leverage diagrams and examples to present a dynamic presentation that elevates understanding for the reader in a compelling manner.

Thank you for sharing your insights and highlighting the innovative approaches discussed in the blog post, especially in relation to ETag. The utilization of diagrams and real-world examples undoubtedly enhances the reader’s comprehension in a substantive way. We firmly believe that leveraging such dynamic presentations not only facilitates a deeper understanding but also fosters an environment of learning that is both engaging and informative. It’s encouraging to see the community’s positive reception and the valuable discussions that emerge around these key technological concepts.

Re: ETag and HTTP Caching

#18
post #11

An approach like https://github.com/benbjohnson/hashfs allows file names to be updated at runtime to be content hashed. This removes the need for the extra "304 Not Modified" API calls from the client. This content hash based file renaming is usually done using a build step which renames files. For applications where the static file serving and HTTP request processing are done in the same application, this can be don…

I use content hashes for some of the images in parts of my site. And I use the IPFS scheme for it, and have the path be under /ipfs/ or some such. And so you could find the same file on IPFS if anyone served it there, as the content hash in the url tells you what to look for. Even though on my side I’ve done this all completely manually, so much so that it’s literally just me calculating the IPFS hash on my machine o…

Wait what?

Browsers now offer to load over IPFS?

I was wondering how you can trust an IFPS gateway, does does browser verify the file is legit using some checksum? Maybw subresource integrity supports IPFS content hashing or something? How does it generate cid anyway ?

https://docs.ipfs.tech/concepts/content-addressing/#cids-are...

How would you use SRI here to verify the cid (and not an additional out-of-band hash) make sure the gateway isn’t returning some crap to, say, inject malicious JS?

Re: ETag and HTTP Caching

#19
post #18

Earlier quoted context omitted.

I use content hashes for some of the images in parts of my site. And I use the IPFS scheme for it, and have the path be under /ipfs/ or some such. And so you could find the same file on IPFS if anyone served it there, as the content hash in the url tells you what to look for. Even though on my side I’ve done this all completely manually, so much so that it’s literally just me calculating the IPFS hash on my machine o…

Wait what? Browsers now offer to load over IPFS? I was wondering how you can trust an IFPS gateway, does does browser verify the file is legit using some checksum? Maybw subresource integrity supports IPFS content hashing or something? How does it generate cid anyway ? https://docs.ipfs.tech/concepts/content-addressing/#cids-are... How would you use SRI here to verify the cid (and not an additional out-of-band hash)…

So in my case, I am not using SRI. But I am using the CID as the name in the path.

Using the example file from your link, I would host it as something like

https://mywebsite.example.com/ipfs/QmPK1s3pNYLi9ERiq3BDxKa4X...

And this was enough for that particular browser I was using to recognize that this file can be attempted to be retrieved directly from IPFS

Re: ETag and HTTP Caching

#20

Earlier quoted context omitted.

In the blog post that was shared in this Hacker News post they explore themes such as ETag, and leverage diagrams and examples to present a dynamic presentation that elevates understanding for the reader in a compelling manner.

Thank you for sharing your insights and highlighting the innovative approaches discussed in the blog post, especially in relation to ETag. The utilization of diagrams and real-world examples undoubtedly enhances the reader’s comprehension in a substantive way. We firmly believe that leveraging such dynamic presentations not only facilitates a deeper understanding but also fosters an environment of learning that is bo…

We appreciate your insightful comment about the benefits of HTTP ETag. It's indeed a powerful mechanism for optimizing web performance and reducing bandwidth usage. Thank you for sharing your expertise on this topic!
Post reply on HN