Skip to content
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

Proxito: refactor CDNCacheTagsMixin #10124

Open
stsewd opened this issue Mar 8, 2023 · 0 comments
Open

Proxito: refactor CDNCacheTagsMixin #10124

stsewd opened this issue Mar 8, 2023 · 0 comments
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code

Comments

@stsewd
Copy link
Member

stsewd commented Mar 8, 2023

When I wrote this mixin, it was to re-use it in the footer, search and related views where the project and version are given in the URL

class CDNCacheTagsMixin:

But now we have views that are a little more complex on how they extract the project and version, and even ones that don't map to a version. All proxito views do map to at least one version (the one that belongs to the domain), so we can start with that being the default, probably.

This is kind of related to these attributes that we pass from several views to the middleware

project_slug = getattr(request, 'path_project_slug', '')
version_slug = getattr(request, 'path_version_slug', '')

(they are used to set the cache tags!)

Haven't thought of a solution yet, but just wanted to open an issue, so we don't forget.

@stsewd stsewd added Accepted Accepted issue on our roadmap Improvement Minor improvement to code labels Mar 8, 2023
stsewd added a commit that referenced this issue Mar 28, 2023
In order to be able to cache the redirects,
I had to refactor some of our code
(and kind of a little in the direction of #10124).

Closes #10144
stsewd added a commit that referenced this issue Apr 19, 2023
In order to be able to cache the redirects,
I had to refactor some of our code
(and kind of a little in the direction of #10124).

Closes #10144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Projects
None yet
Development

No branches or pull requests

1 participant