I have an application that reads an xml file every 5 minutes (using a cronjob) and saves about 700 url’s to images inside a database.
After 5 minutes, most of the images are deleted and the process begins again.
My site would be allot faster if i’d save the images locally but I want some advice on the way to do it.
- I tried using fopen, curl – but writing so many images at once just brakes everything down.
- How about saving them as bloob? How much will this affect the speed?
Any ideas?
I will not suggest storing as blob, instead you can save the locally stored image name into database. Storing so many images in blob will require a great resource unnecessarily.
You can try this out.
When you access that xml file get all the url and store in to temp table say
unsaved_images_urlwith aidandurlas column.Then locally fetch the rows from above tables and save images on disk. This can be done shell script or something I am not sure. And after you have saved the image locally delete that row from database.