summaryrefslogtreecommitdiffstats
path: root/core/templates/layout.user.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-08-29 14:55:23 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-08-30 09:00:16 +0200
commit14136295b7568c6e34504c101eba0ee10f5c74fd (patch)
tree8fa8c31163b4a4fc8621919f330f22e5631af385 /core/templates/layout.user.php
parentc481210e2b24706f4cb0159bd82eb16ec58d9e92 (diff)
downloadnextcloud-server-14136295b7568c6e34504c101eba0ee10f5c74fd.tar.gz
nextcloud-server-14136295b7568c6e34504c101eba0ee10f5c74fd.zip
Cache avatars properly
* Set proper caching headers for avatars (15 minutes) * For our own avatar use some extra logic to invalidate when we update
Diffstat (limited to 'core/templates/layout.user.php')
-rw-r--r--core/templates/layout.user.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 17f895bc17d..b5466b6fc05 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -66,8 +66,8 @@
<div class="avatardiv<?php if ($_['userAvatarSet']) { print_unescaped(' avatardiv-shown'); } else { print_unescaped('" style="display: none'); } ?>">
<?php if ($_['userAvatarSet']): ?>
<img alt="" width="32" height="32"
- src="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 32]));?>"
- srcset="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 64]));?> 2x, <?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 128]));?> 4x"
+ src="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 32, 'v' => $_['userAvatarVersion']]));?>"
+ srcset="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 64, 'v' => $_['userAvatarVersion']]));?> 2x, <?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 128, 'v' => $_['userAvatarVersion']]));?> 4x"
>
<?php endif; ?>
</div>