caching the site

Posted on 2005-05-16
Last Modified: 2006-11-18
I'm having some issues, my site is dynamic and the problem I'm having is that the ISP cache my witch does not make it very dynamic.

Is there anyway with php I stop the ISP's caching the site?
Question by:submissiontechnology
    LVL 4

    Accepted Solution

    r u sure it's the ISP and not the browser doing caching? as in, you can curl or telnet to the webservice and are unable to pull down revised pages? If it really is your ISP, then you'll have to call them and tell them to stop caching because, when you think about it, if they're serving the page from cache, then it won't hit your web application at all anyways so any changes won't apply. If it's a browser issue, you can use Pragma no-cache.

    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="-1">

    in your HTML header.

    Author Comment

    Should it be like this?

    <META Http-Equiv="Cache-Control" Content="no-cache">
    <META Http-Equiv="Pragma" Content="no-cache">
    <META Http-Equiv="Expires" Content="0">
    LVL 7

    Expert Comment

    Some proxies obey commands like that. Perhaps the fastest way to tell would be to place a date command in your script and set your browser to every visit to the page.

    <? echo "This page generated on ".Date("Y/m/d h:i:s "). ' for ' . $_SERVER[HTTP_HOST]; ?>

    Something like that.

    LVL 9

    Expert Comment

    Hi, you can use headers..

    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
    header("Expires: Mon,26 Jul 1997 05:00:00 GMT");


    Author Comment

    Thanks guys :) your all stars

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now