The Core

Why We Are Here => Hardware & Technology => Topic started by: rcjordan on September 06, 2013, 02:09:30 PM

Title: PHP include pages cached by browser?
Post by: rcjordan on September 06, 2013, 02:09:30 PM
Looks to me like they are. If so, I'll move a large chunk of logic that called by many pages to an include to ease pounding the server unnecessarily after the 1st page is digested.
Title: Re: PHP include pages cached by browser?
Post by: Drastic on September 06, 2013, 03:52:08 PM
Include alone shouldn't be cached, should be the whole page.
Title: Re: PHP include pages cached by browser?
Post by: rcjordan on September 06, 2013, 04:06:51 PM
OK. Thanks.
Title: Re: PHP include pages cached by browser?
Post by: IrishWonder on September 06, 2013, 04:43:48 PM
Unless I misunderstood the question, aren't browsers caching the resulting HTML rather than php?
Title: Re: PHP include pages cached by browser?
Post by: Rooftop on September 06, 2013, 04:48:48 PM
As IrishWonder says, it is only the resulting HTML that can be cached - as part of the wider page.  The browser isn't even able to tell which parts are from an include and which are not as it is all put together server-side.
Title: Re: PHP include pages cached by browser?
Post by: rcjordan on September 06, 2013, 06:37:11 PM
Yeah, I was thinking along the lines of external js files and had what I thought was a caching event happen with the php include.  Turns out it was a problem with a particular variable.