1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00
Marcus Crane 335cfcde57 Use relative links that work locally and in production
At present, a mix of link types are used in the Netbox
documentation from markdown file links to relative and
absolute anchor links.

Of the three types, linking to markdown files is the
most ideal because it allows navigation locally on disk,
as well as being translated into working links at render
time.

While not obvious, mkdocs handles converting markdown
links to valid URLs.

Signed-Off-by: Marcus Crane <marcu.crane@daimler.com>
2021-03-18 19:39:03 +13:00

1.3 KiB

Caching

NetBox supports database query caching using django-cacheops and Redis. When a query is made, the results are cached in Redis for a short period of time, as defined by the CACHE_TIMEOUT parameter (15 minutes by default). Within that time, all recurrences of that specific query will return the pre-fetched results from the cache.

If a change is made to any of the objects returned by the query within that time, or if the timeout expires, the results are automatically invalidated and the next request for those results will be sent to the database.

Invalidating Cached Data

Although caching is performed automatically and rarely requires administrative intervention, NetBox provides the invalidate management command to force invalidation of cached results. This command can reference a specific object my its type and numeric ID:

$ python netbox/manage.py invalidate dcim.Device.34

Alternatively, it can also delete all cached results for an object type:

$ python netbox/manage.py invalidate dcim.Device

Finally, calling it with the all argument will force invalidation of the entire cache database:

$ python netbox/manage.py invalidate all