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

Thread: How clear Apache cache?

  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,941
    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,941
    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

    Default Re: How clear Apache cache?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Where is the website? This could easily happen with a proxy server
    somewhere on which you do not plan. For example, if your website is
    outside your network any number of devices between your computer and the
    web server could cache pictures for you. Similarly if your server is in
    your network but your system or browser is configured to use a proxy
    server then that proxy could be "helping" you or your organization. Using
    a Firefox plugin like Live HTTP Headers (or getting a LAN trace if the
    traffic is not encrypted) would probably show this fairly well.

    Either way, ken's right; Apache doesn't cache by default.

    Good luck.





    On 09/01/2010 06:06 PM, 6tr6tr wrote:
    >
    > 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.
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.15 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iQIcBAEBAgAGBQJMfvGlAAoJEF+XTK08PnB50dEP/01SYM44BfK3l1d/f4SQSFXL
    n7nL00YPsXwZxHazVEmyOlEyYYMzwgbUCf6QXK7nQsb7S8A4rFBN3McgS59NDooZ
    mJ/LeMoCAAkFZM1D4KKU5LH7W59UXQi5g2ljnaDQ6KLzUwKISdeIrAjvNm9a2mcr
    GlZe5R8GymC4/bc/PJLICnCBzQT/0xV+ScMzvu7CmyZ4UgJqBy9eHpwgZ+vAfnPd
    5uKj/sBhOr0OqAa5QkZReUy6kES9WHHvR9q+++50mwvEJAMP4hLqUkgWG2RztIxF
    xs3TgjIYKpO9oC8EGdkHAkp5A6GRib0CDrchJh6/pmM0wXfZgJaXSZ3QP/nuadUU
    TDkQJ/b8kQStE03BjY8DaYQHc7mqfezUU+7zNzowSkBViJ6Up8imA8JKNKsDqwLF
    ZNbrET1M+4RU1ki1gEjrDcC2keFtUsiCqNtVcYk6Vtth1jCH+e42ajutfCSks4+f
    ElXYbIpP1qaqZBlN0BVkuQst5uetPWfxP8jWk0dlB5ITzDKqFCaAILX/SbgHbvtO
    9XDtCnROFKkReccTgDq/PAjfTIgouPpubAiu0f9siaHKsq5R8TEMagA5PFLl70nT
    ucw+CFRTQx47D+lHntlSCERe2L4r/XQRAODh1zhySzzUqQjs7staorT05A/iyEMl
    y4w2jgKo4dut3eofQNSL
    =8+xN
    -----END PGP SIGNATURE-----

  8. #8
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,941
    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.

  9. #9

    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.

  10. #10

    Default Re: How clear Apache cache?

    Still getting this issue.

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
  •