Skip to content

Proxito: add top-level docs #8913

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

Merged
merged 2 commits into from
Feb 16, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions readthedocs/proxito/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Proxito
=======

Module in charge of serving documentation pages.

CDN
---

We use the ``CDN-Cache-Control`` header to control caching at the CDN level,
this doesn't affect caching at the browser level (``Cache-Control``).
See https://developers.cloudflare.com/cache/about/cdn-cache-control.

The cache control header is only used when privacy levels
are enabled (otherwise everything is public by default).

By default, all requests on proxito are marked as private,
but individual views may mark a request as public.
This was done since what is considered public varies on each view,
or the details to know this are only accessible on the view itself
(like the final project attached to the request).

What can/can't be cached?
~~~~~~~~~~~~~~~~~~~~~~~~~

- Footer: should never be cached.
We show a different footer depending on the user,
even if they are on a public version.
- ServePageRedirect: can be cached for public versions, or for all versions,
as the final URL will check for authz.
- ServeDocs: can be cached for public versions.
- ServeError404:
This view checks for user permissions, can't be cached.

We could cache it only:
- If the response is a redirect (slash redirect or user redirect) and the version is public.
- If current version and the default version are public (when serving a custom 404 page).

- ServeRobotsTXT: can be cached, we don't serve a custom robots.txt
to any user if the default version is private.
This view is already cached at the application level.
- ServeSitemapXML: can be cached. It displays only public versions, for everyone.
This view is already cached at the application level.
- Embed API: can be cached for public versions.
- Search:
This view checks for user permissions, can't be cached.
Additionally, to the privacy level of the version,
we check for authz when including results from subprojects,
so search results may be distinct for each user.

We could cache it only:
- If the project doesn't have subprojects.
- All subprojects are public.
- Analytics API: can't be cached, we want to always hit our serves with this one.