-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
/ipns/ should redirect to /ipfs/ and/or cache #3861
Comments
IPNS system is up for major rewrite (introduction of Inter Planetary Record System), this would be a place where cache duration configuration would probably be implemented. Time of this rewrite isn't specified. #132 was just a proposal how this feature could be implemented, it was implemented otherwise. Plain redirecting isn't great idea IMO as it will prevent the site from updating. There is a bit of conflict here as some sites don't worry about downgrade or progress stop attacks but others do. Currently IPNS has no way to express that so it takes the most conservative path. IPRS hopefully will be able to express that and thus solves this issue. Using ETag with no timeout is very neat idea. It might be worth creating separate actionable issue that asks for implementation like this. Lack of caching in IPFS is because we cannot get TTL of DNS record and we focus a lot on C in CAP theorem. |
@Kubuxu As I understand, the 307 HTTP status should keep the /ipns URI in the browser window, therefore bookmarking the mutable URI is still possible. Did I miss something? |
@wigy-opensource-developer None of the redirects keep the address bar. You can try here: https://jigsaw.w3.org/HTTP/300/307.html The only way to maintain address bar server-side is to proxy the content—like go-ipfs is currently doing. (Client side you can use an <iframe>.) |
@Kubuxu Thanks for the heads up on IPRS. Was not aware of this planned change, good to know! Looks like a solid improvement over IPNS.
Sorry, you lost me here. What is a downgrade attack and progress stop attack? I couldn't find a mention of them in the github repo's outside of this issue.
Thanks! This looks like an easy job, I might give it a try and submit a PR this week.
I don't fully understand how DNS come in to play, I'll read up on DNS-links. |
The key here is that currently IPNS prefers no record over oldish or expired record. This is what was decided long time ago and possibility of changing it is a separate matter.
IPNS allows also for DNS resolution, |
What has happened with this so far? |
A common use case I use is to pin documentation sites so that I can browse them offline The issue is that I cannot browse it offline as it refuses to resolve the IPNS. I need to manually note the hash when I pin, so I can browse to that instead. |
Closing. |
Version information:
Type: Feature
Severity: Medium (performance issue)
Description:
Currently,
/ipfs/
request have maximal caching implemented, which is great for performance as it allows offloading load to caches (reverse proxies, Cloudflare, browser, etc). The/ipns/
are mutable, so the same treatment would not work. Currently, they don't provide any form of caching, making every request go all the way back to the (comparatively slow) origin node.Addendum:
There is currently a very low severity bug in the handling of the
If-None-Match
header for/ipns/
requests. It is incorrectly handled like the/ipfs/
requests, and returns304 Not Modified
if set to the ipns base name, even though the content may have changed. This is very low severity since/ipns/
never sets anETag
header to begin with.Proposal:
I propose to implement the following:
On
/ipns/
requests always set theETag
to the current/ipfs/
base name.If the request contains a
If-None-Match
header, check the ETag and reply with304 Not Modified
if appropriate.Add a configuration option
GateWayconfig.IpnsRedirect bool
.If the boolean is set, reply to
/ipns/
requests with a 307 redirect to the current/ipfs/
path and include a header for 5 minute caching. (ipns updates, AFAIK, have no global consistency guarantees, so this should not hurt. Even a slight caching header can be the difference between 10k requests per second and 1 request per minute.)If the boolean is not set, reply as before, but also include the ETag header described above.
Relevant prior discussions:
Redirection has been mentioned earlier in issue 132:
Issue 132 is closed, but this particular feature is currently not implemented. In issue 1234 it was suggested again, but at least one user had a problem with it in the context of dns links (something I don't understand).
Questions:
The text was updated successfully, but these errors were encountered: