-
-
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
When used to host static websites cache-timeout should not be 48 weeks #1234
Comments
Suggested solution in #1208: diff --git a/core/corehttp/ipns_hostname.go b/core/corehttp/ipns_hostname.go
index 7361001..0da667c 100644
--- a/core/corehttp/ipns_hostname.go
+++ b/core/corehttp/ipns_hostname.go
@@ -19,8 +19,8 @@ func IPNSHostnameOption() ServeOption {
defer cancel()
host := strings.SplitN(r.Host, ":", 2)[0]
- if p, err := n.Namesys.Resolve(ctx, host); err == nil {
- r.URL.Path = "/ipfs/" + p.String() + r.URL.Path
+ if _, err := n.Namesys.Resolve(ctx, host); err == nil {
+ r.URL.Path = "/ipns/" + host + r.URL.Path
}
childMux.ServeHTTP(w, r)
}) For |
Agreed. We should keep in mind what the request is and use that to determine whether or not to cache. Actually, ideally we would do 302 redirects (not cached) to proper /ipfs/ path (immutable, cached forever). — On Sat, May 16, 2015 at 2:57 PM, Knut Ahlers [email protected]
|
Actually 307 — On Sat, May 16, 2015 at 2:57 PM, Knut Ahlers [email protected]
|
I don't think so. That would be really ugly and at least prevent me 100% from using IPFS for static websites. Imagine this:
In my special case:
(The change is not for |
@Luzifer Mmm yeah one doesn't see the output of the redirects for assets, but does for the main page. Wait, we should test whether 307 displays the original URL. Since it is "temporary only" it may display the original and hide the redirect. |
Nah. The redirect is shown in the browser as expected. If you wanna test yourself: package main
import (
"fmt"
"net/http"
"github.com/gorilla/mux"
)
func main() {
r := mux.NewRouter()
r.HandleFunc("/patha", func(res http.ResponseWriter, r *http.Request) {
http.Redirect(res, r, "/pathb", 307)
})
r.HandleFunc("/pathb", func(res http.ResponseWriter, r *http.Request) {
fmt.Fprintf(res, "ohai")
})
http.Handle("/", r)
http.ListenAndServe(":4000", nil)
} |
@Luzifer bummer. |
Blocked by #1267 |
As a website owner hosting his website in IPFS I want to be able to make updates to that page.
Scenarios
dnslink
TXT DNS entrySolution
Apply the solution used for
/ipns/...
hashs also to requests coming from adnslink
entrySteps to check
The text was updated successfully, but these errors were encountered: