Author Topic: PHP include pages cached by browser?  (Read 2522 times)

rcjordan

  • I'm consulting the authorities on the subject
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 16268
  • Debbie says...
    • View Profile
PHP include pages cached by browser?
« 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.

Drastic

  • Need a bigger hammer...
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3084
  • Resident Redneck
    • View Profile
Re: PHP include pages cached by browser?
« Reply #1 on: September 06, 2013, 03:52:08 PM »
Include alone shouldn't be cached, should be the whole page.

rcjordan

  • I'm consulting the authorities on the subject
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 16268
  • Debbie says...
    • View Profile
Re: PHP include pages cached by browser?
« Reply #2 on: September 06, 2013, 04:06:51 PM »
OK. Thanks.

IrishWonder

  • Inner Core
  • Hero Member
  • *
  • Posts: 561
    • View Profile
    • IrishWonder's SEO Consulting
Re: PHP include pages cached by browser?
« Reply #3 on: September 06, 2013, 04:43:48 PM »
Unless I misunderstood the question, aren't browsers caching the resulting HTML rather than php?

Rooftop

  • Inner Core
  • Hero Member
  • *
  • Posts: 1915
    • View Profile
Re: PHP include pages cached by browser?
« Reply #4 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.

rcjordan

  • I'm consulting the authorities on the subject
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 16268
  • Debbie says...
    • View Profile
Re: PHP include pages cached by browser?
« Reply #5 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.