Remove the clearcache management command #8929

Closed
opened 2025-12-29 20:42:59 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Dec 7, 2023).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

Remove the clearcache management command (from the core app), and omit it from the upgrade script.

Justification

This command was introduced back when we were experimenting with query caching, and is no longer needed. I was mistaken; it was actually introduced under #9122 to provide a mechanism for clearing the cached API spec. However, this is also no longer used since we moved to drf-spectacular (see #9608).

The Django cache is currently used only for discrete caching operations, including:

  • Config revision tracking
  • Recording the most recent release
  • Caching RSS feed content (the RSSFeedWidget)

There has already been at least one bug related to this function (see #14182). Additionally, plugins may utilize the cache for other purposes, and we cannot make the assumption that it is safe to clear other cached data.

Impact

Any mechanisms within NetBox or a plugin which employ caching will be responsible for their own cleanup, where applicable.

Originally created by @jeremystretch on GitHub (Dec 7, 2023). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes Remove the `clearcache` management command (from the `core` app), and omit it from the upgrade script. ### Justification ~This command was introduced back when we were experimenting with query caching, and is no longer needed.~ I was mistaken; it was actually introduced under #9122 to provide a mechanism for clearing the cached API spec. However, this is also no longer used since we moved to `drf-spectacular` (see #9608). The Django cache is currently used only for discrete caching operations, including: * Config revision tracking * Recording the most recent release * Caching RSS feed content (the RSSFeedWidget) There has already been at least one bug related to this function (see #14182). Additionally, plugins may utilize the cache for other purposes, and we cannot make the assumption that it is safe to clear other cached data. ### Impact Any mechanisms within NetBox or a plugin which employ caching will be responsible for their own cleanup, where applicable.
adam added the status: acceptedtype: deprecation labels 2025-12-29 20:42:59 +01:00
adam closed this issue 2025-12-29 20:42:59 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8929