Hello all Im trying to understand how ob_start and end works, currently its using a lot of disc performance due to 500 requests per second on my webserver which kinda halts the discs. So what im trying to do is to use ob_start because thats only using memory but im not sure how it works really and i would appreciate if someone could help me. $data = 'iVBORw0KGgoAAAANSUhEUgAAABwAAAASCAMAAAB/2U7WAAAABl' . 'BMVEUAAAD///+l2Z/dAAAASUlEQVR4XqWQUQoAIAxC2/0vXZDr' . 'EX4IJTRkb7lobNUStXsB0jIXIAMSsQnWlsV+wULF4Avk9fLq2r' . '8a5HSE35Q3eO2XP1A1wQkZSgETvDtKdQAAAABJRU5ErkJggg=='; $data = base64_decode($data); //ob_start(); $im = imagecreatefromstring($data); header('Content-Type: image/png'); imagepng($im); //ob_end_clean ( ); PHP:
why not caching the results? disk is mostly faster then MySQL (except when mysql loads into memory). And most frequently used files are cached to into memory.. it's better to cache output and use the cache instead of creating the same page over and over again..