https://www.icyphoenix.com/viewtopic.php?f=17&t=9374&p=60006#p60006 ----------------------------------- mort Sat 31 Jan, 2015 23:20 Re: What To Cache Or Not? ----------------------------------- I do understand what you are saying - Maybe the whole subject is confusing.. :lol: But this is how I ended up doing it anyway. So the page is cached as html - gZipped and not serialized. ;) [spoiler][code linenumbers=false] 'cache/gamedata/', 'prefix' => 'gnu_', 'expire' => $set['cachelife'])); $data = $cache->read(''.$template.'.newest_header'); if ($data) { echo $data; }else{ $cache->start_caching(); $limit_header_block = intval($limit_header_block); $ID = isset($_GET['ID']) ? intval($_GET['ID']) : ''; echo '
'.IMG_THL.'
'.$lang['newest_games'].'
'.IMG_MIN.' onclick="ShowHide(\'c41_f\',\'c41_f_h\',\'c41_f\');" alt="'.$lang['hide'].'" title="'.$lang['hide'].'" /> '.IMG_THR.''.SCRST.'
'; $stmt = $database->prepare("SELECT ID, name, description, type, views, thumb, thumb_url FROM " . GAMES_TABLE . " WHERE active='1' ORDER BY date_added DESC LIMIT $limit_header_block"); $stmt->execute(); $result = $stmt->fetchAll(PDO::FETCH_ASSOC); foreach( $result as $row ){ $row_id = intval($row['ID']); $row_type = intval($row['type']); $row_views = intval($row['views']); $row_thumb = gnuFile($row['thumb']); $row_thumb_url = urldecode($row['thumb_url']); $bodydata = htmlEsc($row['description']); $game_name = htmlEsc($row['name']); include "editor/editor_bodydata.php"; $game_link = ''.U_GAME_LINK.$row_id.''; if($row['type'] == 1){echo ' '; }else{ echo ' '; } if($row['type'] == 1){ echo ''.IMG_THUMB_B1.$row_thumb.IMG_THUMB_45.''; }else{ echo ''.IMG_THUMB_B2.$row_thumb_url.IMG_THUMB_45.''; } echo ''; } echo '
'.SCRSB.''.IMG_THB.'
'; $cache->write(''.$template.'.newest_header'); $cache->stop_caching(); echo $cache->read(''.$template.'.newest_header'); } ?>[/code][/spoiler] And this is what we get - Neat! isn't it? 8) [spoiler][code linenumbers=false]a:2:{s:6:"expire";i:1422699771;s:4:"data";s:15363:"
Newest Games
Hide
";}[/code][/spoiler]