Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webgateway: sets 'last-modified' header to now() #7968

Open
RubenKelevra opened this issue Mar 10, 2021 · 1 comment
Open

Webgateway: sets 'last-modified' header to now() #7968

RubenKelevra opened this issue Mar 10, 2021 · 1 comment
Labels
effort/hours Estimated to take one or several hours exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked topic/gateway Topic gateway

Comments

@RubenKelevra
Copy link
Contributor

While the web gateway sets the CID as etag in the http header which allows to cache resources properly, the last-modified tag is always the current time.

This doesn't really match what the tag is supposed to reflect: The last time the ressource changed.

Since IPFS has no way of knowing when this occurred, wouldn't it be more correct to not send a last-modified tag at all?

RFC2616 doesn't require a server to have this tag in the response header:

HTTP/1.1 servers SHOULD send Last-Modified whenever feasible.
@RubenKelevra RubenKelevra added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Mar 10, 2021
@Stebalien
Copy link
Member

We set the modification time to "infinitely in the past" when using /ipfs for better caching. However, for /ipns, we set it to the current time to make sure the latest file is always "newer".

But yeah, we could probably just not set the modification time for /ipns.

@Stebalien Stebalien added exp/novice Someone with a little familiarity can pick up effort/hours Estimated to take one or several hours help wanted Seeking public contribution on this issue P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked topic/gateway Topic gateway and removed need/triage Needs initial labeling and prioritization labels Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked topic/gateway Topic gateway
Projects
None yet
Development

No branches or pull requests

2 participants