Redis cashing issue with ::remember

Posted 1 year ago by francois

Hello,

I have this kind of code :

<?php
$response = \Cache::remember($this->context->context->id . 'instagram', 1440, function () {
                $data = $this->instagramScraper->make($this->context->context->socials['instagram']);
                return $this->instagramTransformer->transformCollection($data);
            });
return $this->respond($response);

Cache key is created on redis, and values are correct, but the callback is executed every single time. I say this because my API endpoint is responding in more than 3s.

Thanks

Please sign in or create an account to participate in this conversation.