I have a site that has a lot of images, like user's logo, product's logo/images or company's logo/images.
Now, I store these logos or images name in MySQL. If I want to know one user's logo, I must query mysql, and find the logo. Just like this:
<img src="{{FileManager::getFile('user_logo',$loop->photo)}}" />
The problem is , my site is growing and become bigger and bigger. Suppose, I have a page, which will show users's info (user's name, user's age... user's logo).
That I must query MySQL to find their logo. Everytime, this will cost lots of time waiting for page loading user's logo. I wonder how can I speed up loading logos/images ?
I am using Laravel 4 with this server specification:
- Apache
- PHP 5.4
- MySQL 5.5
- Redis 2.6