You are here: Re: Cached include? « All PHP « IT news, forums, messages
Re: Cached include?

Posted by Julien CROUZET on 10/10/65 11:39

mark a couché sur son écran :
> I have one very large include, which is an array. It's included when
> index.php is loaded. However, I now need to use the same include on
> page2.php, and page3.php and page4.php. Is there a smart way to do
> this and mimize load times on each sudsequent page?

You can serialize() your array and store it in a file, you'll get it by
using $MyArray = unserialize(file_get_contents("thefile.data"));
This file saving can be done with a $_SESSION, but I suppose the
array is the same for all visitors, so you probably don't need a
session
for that.

If you are really looking for an optimized way to include your array,
you can use an optimize like Turck MMCache, APC or AfterBurner which
'compiles' your include file and load it in shared memory.

Greetings,

--
Julien CROUZET - DSI Theoconcept
julien.crouzet@/enlever ca\theoconcept.com
http://www.theoconcept.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация