-
Notifications
You must be signed in to change notification settings - Fork 81
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
Drop .html from URLs? #121
Comments
Hmm. Call me old-fashioned and biased 😜, but I don't think dropping extensions would be a very good idea. I personally like the explicitness of it a lot, i.e. the comfort of knowing that the content delivered from a URL ending in If the goal here is to make the non-technical end user's life easier, we might add an internal redirect from any URL without an extension to the same URL with |
well... technically, only |
My natural inclination would be to agree with you, @rofe and say that the rest of the world that prefers extension-less URLs is wrong. There are two things that give me pause:
I think I'm going to make a PR in
|
Why does it have to be exclusive, why we cannot support both ? |
adobe/helix-dispatch#247 does not support selectors in extension-less paths. And it is entirely additive, i.e. existing URLs work as they did before. You can now leave out |
I don't like this and I'd rather have at least a redirect to a resource that is less ambigous. Also, @davidnuescheler do you still think this is a good idea? |
do you know people that still enter urls manually? |
Is it old-fashioned? Yes. Does that mean it's bad? No. For consistency, I would argue I do know many devs in the wild that consider it to be a sign of old technology. My heart says leave |
I think that serving content from
I just think that for helix, it's quite expensive to test all possible resources. and to make it more stable, I would prefer to send a redirect to the resolved resources, rather than serving it from the non-extension url. |
I think we usually have to end up supporting both, since some sites will want extensions and others won't. A problem with not having extensions is that a site needs to accurately provide the right media type on responses. The problem with having extensions is that a page becomes associated with the type normally associated with that extension, which means some tools/browsers will obey the type and others will obey the extension. Personally, I prefer sites that separately identify computed resources from their source/template files. Typically that means non-extension URIs and extensions on templates/source files. Given the mount of generation we are doing, it might make better performance sense to generate all routes when the source files change, rather than fail backwards. In other words, generate a b-tree or hash table of the site's valid URI-space rather than path traverse on each request. |
Myabe we could do the mapping in Fastly instead of Runtime? |
The implementation in adobe/helix-dispatch#247 is simply trying a hard-coded |
I don't think we would need any fallback other than |
haha, i just got tired of sending people links that end in .html which really i haven't seen on real websites in a very long time... so i quickly added this to my outer cdn code...
and it works beautifully, see here: which makes me agree with @rofe that this is easy and fast to add on the edge without adding any additional requests. .ps: this also supports the distinction between |
I would love such a pragmatic approach. with the current (intended) implementation we would try to load:
from 3 locations (pipeline, content, static).... which results in 9 requests and a gazillions of activations.... if we could remove this logic from the dispatcher, and only use |
(who wanted the |
Just be sure that any change in the path hierarchy is done as a redirect to the client, since otherwise the relative links will break. That's why httpd redirects directory name to name/ instead of just sending the content. |
so I suggest:
@davidnuescheler are you ok with this? the only question remains:
(I'm for real redirects) |
The only thing I would add - for backward compatibility and convenience - is a fallback from I'm on the fence regarding the redirects, slightly leaning towards internal... |
well, my goal is to avoid internal fallbacks and have the entire logic on the CDN with simple redirects. the project can still add a |
i think the
i don't think there is material backwards compatibility there, and the convenience in code to go to |
The I wouldn't want to drop that. |
What would be the query string based solution for |
And I think that 30x redirects to URLs are far more often copied from the browser than written up from scratch, so if you redirect from For |
Sorry to disagree with all of you on every point, but I see the number of activations as a minor detail (as long as they are not in sequence, thus visible as latency), but the URL space as a super important aspect of the UI, and one where we made every addition so far with good reason. |
fine for me.
als long as we don't internally redirect |
I agree, but I think it should stay an external redirect for transparency. If customers don't want to go live with a |
i agree that the mapping should not be external redirects. i also agree that we need to be careful with the URL as an important part of the user experience. adding to that, i think we should have been more careful with the URL space in the past and the multitude of fallbacks actually make it more complicated than needed. while i generally agree that the number of activations should not be our sole guiding principles, i think it is important that we are careful and prudent with all resources, even if they seem "free". having said that, here are some things to consider
|
What I've been thinking of in terms of OOTB experience is what we have on https://www.hlx.page:
Ironically, this feature seems to be broken or disabled for Helix Pages, resulting in the ugly URL. If we say the OOTB experience does start with fstab, then we need to polish the path to get there, so that it is as easy as entering a GitHub URL in a text field. Anyway, the directory index lookup order is configurable, and if you all want to change the default from |
Mildly less desirable in the same way as a pizza that fell on the floor, face-down. It might taste the same, but your guests will still think there's something weird about it. URLs with question marks are by definition more questionable than those without. There is another aspect of this: the client-side fallback logic would need to be duplicated for every kind of resource that can have a fallback, e.g. topics, products, authors. So I'd say the default fallback takes a lot of complexity away from the project, at minimal complexity cost for us, and only moderate (and minimizable) runtime overhead.
The extra complexity: definitely. Let's see what we can do about the extra cost and "every single request" aspect. The But maybe we can find a way to create URLs that enable dynamic default feature selectively, so that we can further reduce it:
We could pick a different delimiter, but
I think we did. If |
Just spoke with @davidnuescheler and came up with an alternative implementation that would allow us to handle the In mountpoints:
/authors: https://adobe.sharepoint.com/sites/TheBlog/Shared%20Documents/theblog/authors?fallback=default-author.docx
/topics: https://adobe.sharepoint.com/sites/TheBlog/Shared%20Documents/theblog/topics?fallback=default-topic.docx
/: https://adobe.sharepoint.com/sites/TheBlog/Shared%20Documents/theblog We then push the fallback handling either into |
I suggest to handle it in the content-proxy. also, maybe it's time to convert/allow the fstab to be a list of objects again: mountpoints:
- root: /authors
source: https://adobe.sharepoint.com/sites/TheBlog/Shared%20Documents/theblog/authors
fallback: default-author.docx
- root: /topics
source: https://adobe.sharepoint.com/sites/TheBlog/Shared%20Documents/theblog/topics
fallback: default-topic.docx
- root: /
source: https://adobe.sharepoint.com/sites/TheBlog/Shared%20Documents/theblog this wold also allow better ordering of the resolution order and allow multiple roots: mountpoints:
- root: /
source: github
- root: /
source: https://adobe.sharepoint.com/sites/TheBlog/Shared%20Documents/theblog/authors |
I'm not sure what multiple roots would give us, other than complexity and lengthy explanations, but I can agree that a mount-point entry could be an object (in addition to a string), this would not break compatibility. |
maybe it's out of the context here, but we discussed somewhere if the the pipeline (or content-proxy) should first load the md from github or the external, and/or if it should fallback. |
I suggest a quick vote to see if we have consensus. Just use 👍 and 👎 We will then create separate PRs for each item
|
@trieloff ^^^ this also implies:
|
BREAKING CHANGE: As discussed in adobe/helix-home#121 (comment) `README.html` is no longer a default directory index. Either rename your `README.md` to `index.md` or set the [`directoryIndex`](https://github.com/adobe/helix-shared/blob/master/docs/strains-definitions-anystrain-oneof-runtime-strain.md#directoryIndex) property in your strain config to `index.html,README.html` to restore the old behavior fixes #268
BREAKING CHANGE: As discussed in adobe/helix-home#121 (comment) `README.html` is no longer a default directory index. Either rename your `README.md` to `index.md` or set the [`directoryIndex`](https://github.com/adobe/helix-shared/blob/master/docs/strains-definitions-anystrain-oneof-runtime-strain.md#directoryIndex) property in your strain config to `index.html,README.html` to restore the old behavior - fixes #267 - fixes #268 - fixes #269
# [4.0.0](v3.2.25...v4.0.0) (2020-07-01) ### Bug Fixes * **path:** changes to extension less request fallbacks ([8ea8b65](8ea8b65)), closes [#267](#267) [#268](#268) [#269](#269) ### BREAKING CHANGES * **path:** As discussed in adobe/helix-home#121 (comment) `README.html` is no longer a default directory index. Either rename your `README.md` to `index.md` or set the [`directoryIndex`](https://github.com/adobe/helix-shared/blob/master/docs/strains-definitions-anystrain-oneof-runtime-strain.md#directoryIndex) property in your strain config to `index.html,README.html` to restore the old behavior
Looks like adobe/helix-dispatch#267 isn't enough yet for a URL like https://theblog-adobe.hlx.page/en/publish/2020/06/10/listening-learning-and-taking-action to work... do we need adobe/helix-content-proxy#32 - the final piece of the puzzle - for that? |
I think that helix-pages wasn't deployed since we updated helix-publish to use dispatch V4. looking at shows me, that still the 3.x is used: |
Yes,we need to bump the version in helix-cli, too. |
implemented. |
adobe/helix-content-proxy#32 is still open ☝️ |
the fallbacks to github have nothing to do with the extension to .html. |
Some time ago, @davidnuescheler made an offhand remark that we made a mistake when we included the extension in the URL, because people get confused by it, as it is exceedingly uncommon. Also it seems old-fashioned, but not in a cute, ironic
cgi-bin
-way.So, should be drop extensions from the URL, and if yes, how?
The text was updated successfully, but these errors were encountered: