Results 1 to 8 of 8

Thread: Apache caching my file

  1. #1
    Join Date
    Jul 2006
    Posts
    6

    Default Apache caching my file

    After I upload a new version of my file (a zip file) to public_html. Apache still serves up the old version. In fact, it does this even if I delete the file. How can I tell Apache to rescan my public_html?

  2. #2
    Join Date
    Jul 2006
    Posts
    6

    Default

    Hmm..Reproducible in Firefox but not in IE. Must be browser caching. How can I tell Apache to serve the file as non-cacheable to the browser?

  3. #3
    Join Date
    May 2006
    Location
    California
    Posts
    41

    Default

    Browser caching is controlled by your browser. Clear your browser cache.
    Last edited by channeler; 09-25-2006 at 04:19 PM.

  4. #4
    Join Date
    Feb 2006
    Location
    Florida, USA
    Posts
    1,505

    Default

    http://us2.php.net/header
    PHP Code:
    <?php
    header
    ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
    ?>
    http://www.htmlgoodies.com/beyond/re...le.php/3472881

    HTML Code:
    <HTML>
    <HEAD>
    <TITLE>---</TITLE>
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="-1">
    </HEAD>
    <BODY>
    
    Text in the Browser Window
    
    </BODY>
    <HEAD>
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="-1">
    </HEAD>
    </HTML>
    Woo redundant.

  5. #5
    Join Date
    Jul 2006
    Posts
    6

    Default

    Hi Basil,
    Since the file is binary (a zipped Excel spreadsheet), I can't put in the your header text. I think what I need to do is change the HTTP headers. I think this can be done in .htaccess but I need to know what Apache modules are installed by Bluehost.

    Mike
    Last edited by mspertus; 09-25-2006 at 06:20 PM.

  6. #6
    Join Date
    Feb 2006
    Location
    Florida, USA
    Posts
    1,505

    Default

    Sorry, I tend to skim over things.

    I've tested this and it works fine on my box.

    Code:
    ExpiresActive On
    ExpiresByType application/zip A1
    http://httpd.apache.org/docs/1.3/mod/mod_expires.html

    Something like that in your htaccess, I'm not sure what the mime type for zip files is called..
    Last edited by Basil; 09-25-2006 at 09:22 PM.

  7. #7
    Join Date
    Jul 2006
    Posts
    6

    Default

    Basil,
    According to Bluehost, mod_expires is not enabled here.

    Mike

  8. #8

    Default

    Quote Originally Posted by Basil
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="-1">
    Ok, let me get this straight (I'm far from the sharpest of swords)...

    ...If I use the two HTML meta tags above (in both the head section at the top of the page and in a second head section near the bottom), that should cause viewers to have to download those pages without their computer simply using their cached files to bring up the site content?

    That seems straight forwards enough. However, I use Dreamweaver to build my web pages and my website has this in the head also:

    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    Would this conflict with the anti-cache code?
    Last edited by robd101; 10-02-2006 at 03:15 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •