clearing PHP cache

Discussion in 'PHP' started by MayurGondaliya, Apr 25, 2008.

  1. #1
    How can we clear the cached pages at the server level? and how to disable the caching?
     
    MayurGondaliya, Apr 25, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    What kind of caching are you using? OPCode caching?
     
    jayshah, Apr 26, 2008 IP
  3. helpplease

    helpplease Banned

    Messages:
    53
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    1: pages aren't cache'd at server level unless you have a cache engine tunred on such as APC or a one in smarty or suchlike - you'd know if this where the case.

    I think you mean in peoples browsers, you want to send some headers along with your page
    headers are "no-cache" must-revalidate and expires date/in/past
    you send them with this in php

    header('headerbit: value');

    must be at top of page - check php manual under headers, I'm sure there's an example of how to force a no cache by browsers.

    (not all obey though..)
     
    helpplease, Apr 26, 2008 IP
  4. andrew1056

    andrew1056 Peon

    Messages:
    196
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yeah, google the php content expires header. You'll need to send it so that the users browser knows when to query the server rather than their internal cache.
     
    andrew1056, Apr 26, 2008 IP