SirChick Posted January 11, 2008 Share Posted January 11, 2008 Some one told me recently there is a "plugin" not sure if he meant function or some thing else... that allows you to cache your includes to reduce bandwidth .. is this true or has he just been misinformed? If it is true what is it all about and is it worth looking into ? Quote Link to comment Share on other sites More sharing options...
duclet Posted January 11, 2008 Share Posted January 11, 2008 I think they he might be talking about include_once() or require_once(). It works like include() and require() expect that the file is only included once even if you called it in multiple places. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 11, 2008 Share Posted January 11, 2008 Since PHP includes and SSI (server side includes) execute on the server, they don't use your bandwidth. Quote Link to comment Share on other sites More sharing options...
SirChick Posted January 11, 2008 Author Share Posted January 11, 2008 I think they he might be talking about include_once() or require_once(). It works like include() and require() expect that the file is only included once even if you called it in multiple places. How do you apply that withing your scripts exactly? Quote Link to comment Share on other sites More sharing options...
trq Posted January 11, 2008 Share Posted January 11, 2008 I think they he might be talking about include_once() or require_once(). It works like include() and require() expect that the file is only included once even if you called it in multiple places. How do you apply that withing your scripts exactly? Simply use require_once or include_once instead of require/include. This has nothing to do with caching though. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 11, 2008 Share Posted January 11, 2008 Using include/require_once() also only have any meaning if you happen to have files that are included more than once. There is a php cache that holds the parsed version of files, which speed up page execution because the parse phase is eliminated - http://php.net/apc What is your question really about? Includes, bandwidth, speeding up page loading? Quote Link to comment Share on other sites More sharing options...
SirChick Posted January 11, 2008 Author Share Posted January 11, 2008 Well i got the include on one page globally. So i guess it would work ? I'll give it a go.. does any one know what he meant by the caching though ? Thats what he told me though so Im merely asking what i heard from the guy =/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.