Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: How clear Apache cache?

Hybrid View

  1. #1

    Default How clear Apache cache?

    I'm getting a weird situation where even though I updated an image in a folder for a website in apache, it's still showing the old image. And yes, I checked it in multiple browsers and on diff. computers. (Apache is in a virtualbox OS) Here's what I've done:

    1. Checked it in firefox on the host, cleared cache, reloaded
    2. Restarted apache
    3. Checked it in konqueror for first time, still showing old version
    4. Checked it in the actual file folder and it's correct there
    5. Checked it for first time on virtual machine's OS in its firefox, and it shows the wrong/old image

    Any ideas?

  2. #2
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: How clear Apache cache?

    Apache has no cache, it's normally your web browser or any proxies in between. Often a new file is not served because the modification date is older than the file it replaced.

  3. #3

    Default Re: How clear Apache cache?

    Quote Originally Posted by ken_yap View Post
    Apache has no cache, it's normally your web browser or any proxies in between. Often a new file is not served because the modification date is older than the file it replaced.
    No, that's impossible here because when I loaded it into konqueror for the first time ever (I'd never visited the site or viewed the image in konqueror before) it showed the old image! So the old image was still being served up by apache.

    And apache does have some sort of cache: Caching Guide - Apache HTTP Server

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: How clear Apache cache?

    That's only if you have set it up. Out of the box Apache does not have a cache. You can look at the logs in /var/log/apache2 to see if the request was served by a 200 reply or a 304 not modified reply. It could also be a simple typo, you put the new file in the wrong directory or under a different name.

  5. #5

    Default Re: How clear Apache cache?

    Quote Originally Posted by ken_yap View Post
    That's only if you have set it up. Out of the box Apache does not have a cache. You can look at the logs in /var/log/apache2 to see if the request was served by a 200 reply or a 304 not modified reply. It could also be a simple typo, you put the new file in the wrong directory or under a different name.
    Well then what's causing the image not to refresh/change? I tried everything: cleared the whole cache in firefox. Tried viewing the image directly in the browser (not in a web page but straight to the image url) and refreshing. Nothing changes it!

  6. #6

    Default Re: How clear Apache cache?

    The only way I've been able to get it to change the image is to change the name of the image, reload the web page and then change the name back and reload again and then I get the image.

  7. #7
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: How clear Apache cache?

    Is there a proxy between you and the web server? Even one you might not know about, like an ISP's "transparent" proxy.

  8. #8

    Default Re: How clear Apache cache?

    Quote Originally Posted by ken_yap View Post
    Is there a proxy between you and the web server? Even one you might not know about, like an ISP's "transparent" proxy.
    No, the website is hosted locally in an Ubuntu LAMP setup inside VirtualBox. So I've viewed the site both on the host computer and inside the virtual machine and both show this issue.

  9. #9

    Default Re: How clear Apache cache?

    Still getting this issue.

  10. #10

    Default Re: How clear Apache cache?

    Dear 6tr6tr,
    I know this thread is old but thought that a solution would be nice to have so here it is
    I had the exact same problem and yes apache is cacheing the images !
    I would delete the file from the vboxsf then clear the cache from the browser then check in the server directory that the file was not there
    then reload the page and it was still there. How i know it was in the server well i was able to download it from the browser to my desktop.
    What was mind boggling was that updates to the php html or any other parsed file format worked just fine.
    I looked further into the issus and found that apache has a glitch with network mounted folders of NTSF format. Something to the effect that non-parsed elements are sent to the browser and since the file format and permissions on the network drive were incapatible makes apache cache some how. So we want apache to stop processing these elements and force it to read them each time they are requested.
    --->add this to the bottom of the file /etc/apache2/apache.conf

    #Disable image serving for network mounted drive
    EnableSendfile off

    Hope that helps

Page 1 of 2 12 LastLast

Posting Permissions

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