django-cms / django-filer

File and Image Management Application for django
https://django-filer.readthedocs.io/
Other
1.78k stars 581 forks source link

Moving folders and files with permissions as non superuser takes too long #1480

Closed benzkji closed 2 weeks ago

benzkji commented 4 months ago

Superuser click scissor icon (move): Almost immediatly, the move screen appears (dropdown with target folder).

Normal user does the same: It takes ages. Mostly I end up with a "Gateway Timeout". Copying also takes ages.

Does this happen because of permission tests? There are about 100 or 200 folders, an maybe 2000 files in my db, nothing special.

Normal directory listings also take a long time (6 seconds for a list with 79 items).

fsbraun commented 4 months ago

Version?

benzkji commented 4 months ago

Sorry. Latest, 3.1.3.

fsbraun commented 4 months ago

@benzkji Do you have a chance of running a profile, or log the database access?

fsbraun commented 4 months ago

@benzkji For testing, I created a branch which caches permissions to avoid recalculation. This right now is just a guess. Would you like to give it a try?

Here's the branch: https://github.com/fsbraun/django-filer/tree/feat/permissions-cache or simply

pip install git+https://github.com/fsbraun/django-filer@feat/permissions-cache

Please let me know if this is an improvement. Might need some tests, too.

benzkji commented 4 months ago

I can test this in August...thanks!!

benzkji commented 3 months ago

1:1 comparison on my local machine: your branch is way faster. no more timeouts! thanks!

stale[bot] commented 2 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.