Skip to content

Cache all avatar responses - #2416

Merged
LukasReschke merged 1 commit into
masterfrom
cache_all_avatar_responses
Dec 1, 2016
Merged

Cache all avatar responses#2416
LukasReschke merged 1 commit into
masterfrom
cache_all_avatar_responses

Conversation

@rullzer

Copy link
Copy Markdown
Member
  • Cache for 30 minutes
  • Also cache when avatar can't be found

We already did cache avatars when they were found. However, when browsing for example activities and people that did not yet have avatars we still send a lot of requests to the server.

CC: @LukasReschke@nickvergessen@MorrisJobke

@rullzerrullzer added the 3. to review Waiting for reviews label Nov 30, 2016
@rullzerrullzer added this to the Nextcloud 11.0 milestone Nov 30, 2016
@mention-bot

Copy link
Copy Markdown

@rullzer, thanks for your PR! By analyzing the history of the files in this pull request, we identified @nickvergessen, @LukasReschke and @MorrisJobke to be potential reviewers.

Comment threadcore/Controller/AvatarController.php Outdated
$expires = new \DateTime();
$expires->setTimestamp($this->timeFactory->getTime());
$expires->add(new \DateInterval('PT30M'));
$resp->addHeader('Expires', $expires->format(\DateTime::RFC2822));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough I'll update. it. But note that 1123 relies on 822 which was replaced by 2822. Anyway will update but the format is the same here I believe.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only difference is GMT vs +0000 but I bet one browser will fail on it....

* Cache for 30 minutes
* Also cache when avatar can't be found
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer
rullzerforce-pushed the cache_all_avatar_responses branch from dbac9e8 to 5c602f3CompareNovember 30, 2016 08:43
@MorrisJobke

Copy link
Copy Markdown
Member

Tested and headers are set 👍

@LukasReschke

Copy link
Copy Markdown
Member

LGTM

@LukasReschke
LukasReschke merged commit de807fd into masterDec 1, 2016
@LukasReschke
LukasReschke deleted the cache_all_avatar_responses branch December 1, 2016 12:48
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@rullzer@mention-bot@MorrisJobke@LukasReschke@nickvergessen