Skip to content

Also check latest release for Custom 404 page #8089

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

Open
magenta404 opened this issue Apr 12, 2021 · 3 comments
Open

Also check latest release for Custom 404 page #8089

magenta404 opened this issue Apr 12, 2021 · 3 comments
Labels
Needed: design decision A core team decision is required

Comments

@magenta404
Copy link

The current 404 resolution strategy is:

Firstly, attempt to serve the 404 of the current version (version_slug)
Secondly, try to serve the 404 page for the default version (project.get_default_version())

Would it be possible to fallback to the latest version if the default version doesn't have a 404 page? Our default version is stable, but the 404 is on latest which made me wonder why it wasn't working in all cases.

It would also help if the resolution strategy was documented.

@magenta404 magenta404 changed the title Custom 404 page fallback to latest release Also check latest release for Custom 404 page Apr 12, 2021
@humitos humitos added Needed: documentation Documentation is required Needed: design decision A core team decision is required labels Apr 12, 2021
@humitos
Copy link
Member

humitos commented Apr 12, 2021

Would it be possible to fallback to the latest version if the default version doesn't have a 404 page?

This makes sense to me. We would need to think a little more about this since our 404 checks are already super slow (we hit storage backend multiple times) and this sometimes causes us some problems. Adding an extra check here will definitely increase the times we will hit it.

I already attempted to fix this problem in #6797 but we finally took another direction. The issue is not fixed and that PR would definitely help, but it also increases complexity 🤷

It would also help if the resolution strategy was documented.

This is something we definitely should do in https://docs.readthedocs.io/en/stable/hosting.html#custom-not-found-404-pages -- cc @astrojuanlu

@magenta404
Copy link
Author

magenta404 commented Apr 13, 2021

Thanks and understandable. Another additional (or separate) improvement for consideration is to allow admins to choose which fallback should take priority between stable and latest. Since the fallback is global, that choice could be useful (I would find it useful as I would prefer to use latest for the fallback 404 page after implementing what I needed to, I don't think it will be that important for myself. Might still be a good option).

@astrojuanlu astrojuanlu self-assigned this Apr 19, 2021
astrojuanlu added a commit to astrojuanlu/readthedocs.org that referenced this issue Apr 19, 2021
@astrojuanlu astrojuanlu removed the Needed: documentation Documentation is required label Apr 20, 2021
@astrojuanlu
Copy link
Contributor

We clarified the documentation about the current strategy. I propose to leave the issue open to discuss any changes.

@astrojuanlu astrojuanlu removed their assignment Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required
Projects
None yet
Development

No branches or pull requests

3 participants