Skip to content

Addons: purge /addons/?url= when changing data #10694

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

Closed
humitos opened this issue Aug 31, 2023 · 0 comments · Fixed by #10704
Closed

Addons: purge /addons/?url= when changing data #10694

humitos opened this issue Aug 31, 2023 · 0 comments · Fixed by #10704
Assignees
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code

Comments

@humitos
Copy link
Member

humitos commented Aug 31, 2023

We are currently caching /addons/?url= endpoint. This is great, but there are situations where we need to invalidate the cache:

  • changing any field of the version
  • new versions activated
  • ethicalads due to ad_free change
  • new successful build for a particular version (changes builds.current from the API response)
  • changing any field for the project

When any of these things changes we should be able to trigger a cache invalidation via tags like:

  • project:<slug> version:<slug> addons to invalidate a specific version
  • project:<slug> addons to invalidate it for the whole project

I think there may be more things to consider here, but I wanted to at least open an issue at this point to track this and keep it in mind.

@humitos humitos added Improvement Minor improvement to code Accepted Accepted issue on our roadmap labels Aug 31, 2023
@github-project-automation github-project-automation bot moved this to Planned in 📍Roadmap Aug 31, 2023
@humitos humitos self-assigned this Sep 4, 2023
humitos added a commit that referenced this issue Sep 4, 2023
It follows a similar approach than `FooterHTML` API by adding `rtd-addons` CDN
tag and uses the same signals logic from `readthedocs-ext` to purge the cache
on different events.

Closes #10694
@humitos humitos moved this from Planned to Needs review in 📍Roadmap Sep 4, 2023
@github-project-automation github-project-automation bot moved this from Needs review to Done in 📍Roadmap Sep 5, 2023
humitos added a commit that referenced this issue Sep 5, 2023
* Addons: add `CDN-Tags` to endpoint and auto-purge cache

It follows a similar approach than `FooterHTML` API by adding `rtd-addons` CDN
tag and uses the same signals logic from `readthedocs-ext` to purge the cache
on different events.

Closes #10694

* Addons: allow to be extended by corporate (#10705)

* Define `_get_project` and `_get_version` as individual methods because these
  are required by the API permissions.
* Use `user=` attribute when performing the query for the versions to be
  displayed in the flyout.

Requires #10704
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
Status: Done
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant