funny caching issue

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
dirkmcgirk
Forum Newbie
Posts: 2
Joined: Sun Feb 28, 2010 4:05 pm

funny caching issue

Post by dirkmcgirk »

i'm new to php. I installed PHP & Apache on Windows & got it working. Now, however, I seem to have a funny caching issue. I load a php page (simple page with an echo stmt). Then, I shut down apache. Then, when I refresh the page, I still see the echo stmt. The only way to stop the page from displaying is to remove the file physically (delete it) and then restart apache. Does anyone know why this happens? I can't really do much with my installation as it is...

Travis
davex
Forum Contributor
Posts: 101
Joined: Sat Feb 27, 2010 4:10 pm
Location: Namibia

Re: funny caching issue

Post by davex »

Hi,

So your saying that when you have shut down apache the browser still shows the page? This is the browser caching it and showing the cached copy when no response is forthcoming from the server.

When you restart without the page the browser does get a response but it's a 404 page not found.

I think you'll find if you do a script like:

Code: Select all

<?php
echo time();
?>
And leave apache started then you will see it change when you refresh the page.

If not then maybe it's a cache tag issue but I think that will solve it.

Cheers,

Dave.
dirkmcgirk
Forum Newbie
Posts: 2
Joined: Sun Feb 28, 2010 4:05 pm

Re: funny caching issue

Post by dirkmcgirk »

This was a caching issue...which is what i suspected. If I exit the browser session it would give me a page-not-found (when the server was stopped). The cache setting was "Automatic" & I set it to "Every time I visit page". This works...the scary part is that the page I built was dynamic...it would always show new data & the "Automatic" really never refreshed the page ... even when there was new data.

Anyway, thanks, Dave.

Travis
davex
Forum Contributor
Posts: 101
Joined: Sat Feb 27, 2010 4:10 pm
Location: Namibia

Re: funny caching issue

Post by davex »

Hi,

Glad you got it sorted. If it was a cache problem you might want to consider setting some cache/no-cache headers to avoid it happening without browser settings being changed.

Regards,

Dave.
Post Reply