Redismemcached cannot store resources in the cache. is an image a resource? Is there a way to store images in the server memory, just like normal data. (Not the front-end expires cache, but the server memory cache must exist.) redis/memcached cannot store resources (resources in the cache). is the image a resource?
Is there a way to store images in the server memory, just like normal data.
(The expires cache must exist in the server memory cache instead of the frontend expires cache)
Reply content:
Redis/memcached cannot store resources in the cache. is an image a resource?
Is there a way to store images in the server memory, just like normal data.
(The expires cache must exist in the server memory cache instead of the frontend expires cache)
Directly read the image file and put it in redis.
Redis is binary secure and can be safely stored.
Set ('IMG ', $ img); // show. php $ img = $ redis-> get ('IMG '); header ('content-Type: image/png '); // you may change image/png to image/jpeg if you pic is jpeg. header ('content-Length :'. strlen ($ img); echo $ img;
Convert an imageBase64
And then store the data in redis