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
funny caching issue
Moderator: General Moderators
Re: funny caching issue
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:
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.
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();
?>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
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
Anyway, thanks, Dave.
Travis
Re: funny caching issue
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.
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.