-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Avatar Performance #26585
Comments
Afaik we need to add Etag's for proper caching. |
if an ProTip: Testing caching can only be done by pressing enter in the URL, F5 causes the browser to send a request with
|
oh and apache handles the generation of etags for static files |
But none of the files in OC are static, right ? Because everything goes through PHP to have the app/theme/routing overloading magic. |
css, js and woff files are |
7 days might be a little bit too long to cache the avatars request. 1 or 2 hours would be fine! |
any update ? |
no update, moving to triage for rescheduling |
Hey, this issue has been closed because the label (This is an automated comment from GitMate.io. |
Hey, this issue has been closed because the label (This is an automated comment from GitMate.io.) |
Hey, this issue has been closed because the label (This is an automated comment from GitMate.io.) |
moving to backlog as there is currently no active development on this topic |
In my data/avatars folder i see a lot of empty 2 char folders. likely created by https://github.com/owncloud/core/blob/master/lib/private/AvatarManager.php#L98
They somehow also made it into the oc_filecache with a size of -1
this causes the avatar folder to also stay at a size of -1 because the folder is only scanned shallow: all empty folders stay at -1.
This causes a (shallow) filescan when trying to get an avatar image via eg
http://localhost/owncloud/index.php/avatar/admin/28. In my case this takes 400ms for 240 2 char folders in the avatar folder.
AFAICT introduced with #26124
This is made worse by the
Cache-Control: no-store, no-cache, must-revalidate
header of the http://localhost/owncloud/index.php/avatar/admin/28 response because we call the url twice when navigating to http://localhost/owncloud/index.php/apps/files/?dir=/ @PhilippSchaffrath has details on why we do that.The header is set in https://github.com/owncloud/core/blob/master/core/Controller/AvatarController.php#L138. For users without an avatar image also because the DataResponse in https://github.com/owncloud/core/blob/master/core/Controller/AvatarController.php#L124 and https://github.com/owncloud/core/blob/master/core/Controller/AvatarController.php#L130 is converted to a JSONResponse in https://github.com/owncloud/core/blob/master/lib/public/AppFramework/Controller.php#L92 which overwrites the Cache-Control with the default from the JSONResponse / Response ('Cache-Control' => 'no-cache, must-revalidate').
Replacing the DataResponse with a JSONResponse would allow caching the avatar, eg:
There is another DataResponse that can be replaced, but my Linux VM wit PHPStorm just froze ...
In any case, we should
cc @PVince81 @DeepDiver1975 @IljaN
The text was updated successfully, but these errors were encountered: