Does phalcon supports Image caching if yes please share some example??
|
Aug '16 |
8 |
667 |
0 |
btw muhammadahsan1991 what is the idea of the question ? It doesnt make much of a sence, serving images from the webserver doesnt have much to do with phalcon or any other framwork or application.
Do you mean like you resize your images on the fly and thats why you need caching ? If so take a look at this lib here https://github.com/Intervention/imagecache
I usually do it when I upload image i resize it like this:
images/products/ ID / image name.png
images/products/ ID / thumbs450/image name.png
images/products/ ID / thumbs/image name.png
and each image is saved 3 times, the main image i also resize and reduce the quality to 1280 x 1024, main pic is usually around 60 kb.
Let us know what the idea is
My situation is that my website include images from another server which increases the load time and to decrease the load time I want to cache images on my server so that it quickly loads through it
btw muhammadahsan1991 what is the idea of the question ? It doesnt make much of a sence, serving images from the webserver doesnt have much to do with phalcon or any other framwork or application.
Do you mean like you resize your images on the fly and thats why you need caching ? If so take a look at this lib here https://github.com/Intervention/imagecache
I usually do it when I upload image i resize it like this:
images/products/ ID / image name.png images/products/ ID / thumbs450/image name.png images/products/ ID / thumbs/image name.png
and each image is saved 3 times, the main image i also resize and reduce the quality to 1280 x 1024, main pic is usually around 60 kb.
Let us know what the idea is
do curls to donwload the images in an interval and serve them yourself.
https://github.com/phalcon/website/blob/master/app/controllers/ControllerBase.php#L10
If you depend on dynamic remote content, I'm afraid there's not a simple solution. The thing is, if yoy try to preload those images on your own, it would raise the same performance hit.
Only if those images are static, i.e. they really don't change on a daily basis, you can run nightly cron task to fetch all remote resources and then to serve them on your (hopefully) supercharged nginx web server alongside Phalcon.
Or simply ask remote site to put their static content onto CDN.