Skip to content

Commit b5c47c0

Browse files
committed
fixup! perf: cache pre-fetched mailboxes on the HTTP level
1 parent 7c3cb3f commit b5c47c0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Controller/MessagesController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function index(int $mailboxId,
146146
}
147147

148148
$this->logger->debug("loading messages of mailbox <$mailboxId>");
149-
$sort = $this->preferences->getPreference($this->currentUserId, 'sort-order', 'newest') === 'newest' ? IMailSearch::ORDER_NEWEST_FIRST: IMailSearch::ORDER_OLDEST_FIRST;
149+
$sort = $this->preferences->getPreference($this->currentUserId, 'sort-order', 'newest') === 'newest' ? IMailSearch::ORDER_NEWEST_FIRST : IMailSearch::ORDER_OLDEST_FIRST;
150150

151151
$view = $view === 'singleton' ? IMailSearch::VIEW_SINGLETON : IMailSearch::VIEW_THREADED;
152152

@@ -162,7 +162,9 @@ public function index(int $mailboxId,
162162
);
163163

164164
$response = new JSONResponse($messages);
165-
$response->cacheFor(7 * 24 * 3600, false, true);
165+
if ($etag) {
166+
$response->cacheFor(7 * 24 * 3600, false, true);
167+
}
166168
return $response;
167169
}
168170

0 commit comments

Comments
 (0)