Skip to content

Commit

Permalink
Increase cache time and add invalid old logo
Browse files Browse the repository at this point in the history
  • Loading branch information
arxeiss committed Sep 10, 2022
1 parent 48ea8b4 commit 692564b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/Services/Models/CategoryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,15 @@ public function getImagePath(bool $addFileName = true, bool $absolute = false):

public function getImageUrl(): ?string
{
$filePath = $this->getImagePath();
$url = Cache::get($this->getCacheKey());
if ($url !== null) {
return $url;
}

$filePath = $this->getImagePath();
if (UploadStorageService::exists($filePath)) {
$url = UploadStorageService::url($filePath) . '?v' . UploadStorageService::lastModified($filePath);
Cache::put($this->getCacheKey(), $url, 30 * 60);
Cache::put($this->getCacheKey(), $url, 120 * 60); // save into cache for 2 hours

return $url;
}
Expand Down
1 change: 0 additions & 1 deletion app/Services/Models/SendEmailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public function getFileContent(): ?string
if (Storage::exists($this->getContext()->filename)) {
return Storage::get($this->getContext()->filename);
}
Log::warning(\sprintf("File '%s' does not exists", $this->getContext()->filename));

return null;
}
Expand Down
Binary file added public/img/logo_footer-old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 692564b

Please sign in to comment.