When I add 15 thumbnails(4kb-5kb each) my website tends to slow down a lot or even crashes on 2.5k users online, and without them it can take up to 4.5k-5k.
I made a script that will make thumbnail from animated gif on every image upload and store the path of that image in the database. On every page open before adding the thumbnail my website would deliver from database url, title, id and path to the gif image, only thing that changed is the getting the path of the thumbnail for 15 titles.
My website is http://www.smesniposteri.com/ on the right you can see 15 title I was talking about. Here is the code regarding pages users open each visit with and without thumbnail.
Without:
$sql = "SELECT id, url, hits, subject FROM ".DB_PREFIX."items WHERE `id` != '".$id."' AND `type` = '".$cat."' ORDER BY `timestamp` DESC LIMIT 0, 15;
$result = $db->query($sql);
$template->assign_vars('others_row', array(
'URL' => $url."/".create_item_url($row['id'], $row['subject'], $cat),
'HITS' => number_format($row['hits'], 0, ',', '.'),
'SUBJECT' => $row['subject']
));
with thumbnail:
$sql = "SELECT id, url, hits, subject, thumb_url FROM ".DB_PREFIX."items WHERE `id` != '".$id."' AND `type` = '".$cat."' ORDER BY `timestamp` DESC LIMIT 0, 15;
$result = $db->query($sql);
$template->assign_vars('others_row', array(
'URL' => $url."/".create_item_url($row['id'], $row['subject'], $cat),
'HITS' => number_format($row['hits'], 0, ',', '.'),
'THUMBNAIL' => $row['thumb_url'],
'SUBJECT' => $row['subject']
));