Files with very many references can cause performance issues

Created on 16 March 2023, over 1 year ago

Problem/Motivation

Files with very many references can cause performance issues.

As anyFileUsageHasAnonAccess relies on file_get_file_references this does an entity load on all references. For a file with many references this can use a lot of memory as you could have thousand of entities loaded for this check.

Proposed resolution

Any solution needs some kind of denormalization and respect cacheability of access results.
So add a cache bin that contains access for every file, AND its cacheability.
Consider using DCache module, it will make the logic cleaner.
As a result, with warm cache, determining access does a simple Cache::getMultiple()

Remaining tasks

Implement

User interface changes

TBD

API changes

TBD

Data model changes

TBD

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇳🇿New Zealand ericgsmith

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024