You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Jennifer R. Lee" <JL...@inspireworksinc.com> on 2006/05/04 22:13:44 UTC

[users@httpd] why do I get a 304 when I replace a file with a changed version?

 
Hello All - I have an issue with my Apache server that I do not understand. I am no Apache expert, so I am hoping someone within this forum can tell me if this is expected behavior, a config issue or a possible bug. I see nothing in the FAQ's or bug lists that help me with this. I am testing a copy of our website which is running Apache 2.0.52 on Windows 2000. Our website is in process of being moved to Akamai, where our content will be cached. When the TTL expires on Akamai they make a request to our Apache server to see if the content has changed. The problem I have is that my server almost always returns a 304 'not modified' regardless of whether the file has changed or not. For example, I have two files;
 
a.htm
b.htm
 
b.htm is simply a copy of a.htm with some minor updates so I can see that it changed when I launch it. If I use windows xcopy command, copy command, drag and drop or even the unix toolkit mv command to swap these two files and then launch a.htm, Apache acts as if there was no change, and sends a 304 every time the TTL expires and Akamai serves up the old file. If I use the windows toolkit 'cp' command to exchange the files, THEN it sends a 200 which in turn updates the Akamai cache and I get the right page. I think this is kind of odd, but perhaps that is what I get for running on Windows :-) (not my choice by the way).
 
Any thoughts on this would be appreciated. Also, any hints and tips to how to better debug this. I am pretty much going on what I see in the access log and on the web page, as well as looking at the headers returned from the Akamai edge server(which show the old file date/time not the new one).
 
Many Thanks in advance for any help!
 
Jennifer
 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] why do I get a 304 when I replace a file with a changed version?

Posted by Krist van Besien <kr...@gmail.com>.
On 5/4/06, Jennifer R. Lee <JL...@inspireworksinc.com> wrote:
>
> Hello All - I have an issue with my Apache server that I do not understand. I am no Apache expert, so I am hoping someone within this forum can tell me if this is expected behavior, a config issue or a possible bug. I see nothing in the FAQ's or bug lists that help me with this. I am testing a copy of our website which is running Apache 2.0.52 on Windows 2000. Our website is in process of being moved to Akamai, where our content will be cached. When the TTL expires on Akamai they make a request to our Apache server to see if the content has changed. The problem I have is that my server almost always returns a 304 'not modified' regardless of whether the file has changed or not. For example, I have two files;
>
> a.htm
> b.htm
>
> b.htm is simply a copy of a.htm with some minor updates so I can see that it changed when I launch it. If I use windows xcopy command, copy command, drag and drop or even the unix toolkit mv command to swap these two files and then launch a.htm, Apache acts as if there was no change, and sends a 304 every time the TTL expires and Akamai serves up the old file. If I use the windows toolkit 'cp' command to exchange the files, THEN it sends a 200 which in turn updates the Akamai cache and I get the right page. I think this is kind of odd, but perhaps that is what I get for running on Windows :-) (not my choice by the way).
>
> Any thoughts on this would be appreciated. Also, any hints and tips to how to better debug this. I am pretty much going on what I see in the access log and on the web page, as well as looking at the headers returned from the Akamai edge server(which show the old file date/time not the new one).
>
> Many Thanks in advance for any help!

You must make certain that the timestamp changes on the file. One
thing you can do is use "touch" to set it to the current date.

Krist



--
krist.vanbesien@gmail.com
Solothurn, Switzerland

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] why do I get a 304 when I replace a file with a changed version?

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Jennifer R. Lee wrote:
>  
> If I use windows xcopy command, copy command, drag and drop or even the unix
> toolkit mv command to swap these two files and then launch a.htm, Apache acts
> as if there was no change, and sends a 304 every time the TTL expires

Just a wild observation, but xcopy/copy/etc all preserve the time stamp on win.

If you use

more a.htm > b.htm

what happens?  This will 'touch' the datestamp of b.htm to the current time.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org