|
| 1 | +Proxito |
| 2 | +======= |
| 3 | + |
| 4 | +Module in charge of serving documentation pages. |
| 5 | + |
| 6 | +Read the Docs core team members can view the `Proxito design doc <https://github.com/readthedocs/el-proxito/blob/master/docs/design/architecture.rst>`_ |
| 7 | + |
| 8 | +CDN |
| 9 | +--- |
| 10 | + |
| 11 | +We use the ``CDN-Cache-Control`` header to control caching at the CDN level, |
| 12 | +this doesn't affect caching at the browser level (``Cache-Control``). |
| 13 | +See https://developers.cloudflare.com/cache/about/cdn-cache-control. |
| 14 | + |
| 15 | +The cache control header is only used when privacy levels |
| 16 | +are enabled (otherwise everything is public by default). |
| 17 | + |
| 18 | +By default, all requests on proxito are marked as private, |
| 19 | +but individual views may mark a request as public. |
| 20 | +This was done since what is considered public varies on each view, |
| 21 | +or the details to know this are only accessible on the view itself |
| 22 | +(like the final project attached to the request). |
| 23 | + |
| 24 | +What can/can't be cached? |
| 25 | +~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 26 | + |
| 27 | +- Footer: should never be cached. |
| 28 | + We show a different footer depending on the user, |
| 29 | + even if they are on a public version. |
| 30 | +- ServePageRedirect: can be cached for public versions, or for all versions, |
| 31 | + as the final URL will check for authz. |
| 32 | +- ServeDocs: can be cached for public versions. |
| 33 | +- ServeError404: |
| 34 | + This view checks for user permissions, can't be cached. |
| 35 | + |
| 36 | + We could cache it only: |
| 37 | + - If the response is a redirect (slash redirect or user redirect) and the version is public. |
| 38 | + - If current version and the default version are public (when serving a custom 404 page). |
| 39 | + |
| 40 | +- ServeRobotsTXT: can be cached, we don't serve a custom robots.txt |
| 41 | + to any user if the default version is private. |
| 42 | + This view is already cached at the application level. |
| 43 | +- ServeSitemapXML: can be cached. It displays only public versions, for everyone. |
| 44 | + This view is already cached at the application level. |
| 45 | +- Embed API: can be cached for public versions. |
| 46 | +- Search: |
| 47 | + This view checks for user permissions, can't be cached. |
| 48 | + Additionally, to the privacy level of the version, |
| 49 | + we check for authz when including results from subprojects, |
| 50 | + so search results may be distinct for each user. |
| 51 | + |
| 52 | + We could cache it only: |
| 53 | + - If the project doesn't have subprojects. |
| 54 | + - All subprojects are public. |
| 55 | +- Analytics API: can't be cached, we want to always hit our serves with this one. |
0 commit comments