[Zope-dev] Cache-bug in handling of files
I started this thread on the regular zope mailinglist but now I found a similar posting to my problem in the archives. I have fileobjects where I store pdf-files. If I want to change the pdf-file I use the method "manage_upload". The problem is that if I try to view it it always choose the one that is in the cache. It displays the new one if I open it in a new window or if I save it to disk. The filesize and everything else is for the new file. The thread I found was this: http://zope.nipltd.com/public/lists/zope-archive.nsf/Main/AED89A938194225580256857007679ED?OpenDocument&mode=subject&topic=[Zope]Dumbobjectaliasingquestion This points to a bug report and after serching for it I found it: [754] Zope Bug: Uploaded Images Don't Appear Immediately Category: General Last Updated: Oct 29, 1999 7:05 am Submitted On: Oct 12, 1999 3:58 am Status: Ongoing Reported Version: 2.0.1 Expected/Fixed Version: The strange thing is that this is still Ongoing after almost a year since it was submitted! There was a fix for the problem in the mailinglist thread but 1. I dont know if Image.py is used for all files and 2. I looked in Image.py and didnt fing the code to be similar to the one in the thread. So because I am a newbie in python I want to ask if any1 could take a look at this for me and hopefully make a patch or at least get as much information I need to chunk it in the collector. Peter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Cache-bug in handling of files
Guess noone could help me. I chunked it into the bug collector now. Peter Peter Arvidsson skrev: > > I started this thread on the regular zope mailinglist but now I found a > similar posting to my problem in the archives. > > I have fileobjects where I store pdf-files. If I want to change the > pdf-file I use the method "manage_upload". The problem is that if I try > to view it it always choose the one that is in the cache. It displays > the new one if I open it in a new window or if I save it to disk. The > filesize and everything else is for the new file. The thread I found was > this: > > >http://zope.nipltd.com/public/lists/zope-archive.nsf/Main/AED89A938194225580256857007679ED?OpenDocument&mode=subject&topic=[Zope]Dumbobjectaliasingquestion > > This points to a bug report and after serching for it I found it: > > [754] Zope Bug: Uploaded Images Don't Appear Immediately > Category: General Last Updated: Oct 29, 1999 7:05 am > Submitted On: Oct 12, 1999 3:58 am Status: Ongoing > Reported Version: 2.0.1 Expected/Fixed Version: > > The strange thing is that this is still Ongoing after almost a year > since it was submitted! > > There was a fix for the problem in the mailinglist thread but > 1. I dont know if Image.py is used for all files and > 2. I looked in Image.py and didnt fing the code to be similar to the one > in the thread. > > So because I am a newbie in python I want to ask if any1 could take a > look at this for me and hopefully make a patch or at least get as much > information I need to chunk it in the collector. > > Peter > > ___ > Zope-Dev maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Cache-bug in handling of files
> I have fileobjects where I store pdf-files. If I want to change the > pdf-file I use the method "manage_upload". The problem is > that if I try > to view it it always choose the one that is in the cache. It displays > the new one if I open it in a new window or if I save it to disk. The > filesize and everything else is for the new file. That sounds very suspicious - what are your IE cache settings? > This points to a bug report and after serching for it I found it: > > [754] Zope Bug: Uploaded Images Don't Appear Immediately > Category: General Last Updated: Oct 29, 1999 7:05 am > Submitted On: Oct 12, 1999 3:58 am Status: Ongoing > Reported Version: 2.0.1 Expected/Fixed Version: > > The strange thing is that this is still Ongoing after almost a year > since it was submitted! This bug report was related to the fact that the user was accessing the file through a Squid cache and that at the time (Zope 2.0.1) there was a legitimate bug in the way that "If-Modified-Since" headers were handled. Squid was actually returning the file to him. It should have been marked completed quite a while ago (I just did that). I am using IE 5 (5.00.2314.1003), cache settings set to: "Check for newer versions of stored pages: x Every visit to the page ...and I cannot reproduce the problem that you are describing :( Are these your cache settings? Are you accessing the server through any kind of proxy? Thanks Brian Lloyd[EMAIL PROTECTED] Software Engineer 540.371.6909 Digital Creations http://www.digicool.com ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Cache-bug in handling of files
> > That sounds very suspicious - what are your IE cache settings? > [...] > > This bug report was related to the fact that the user was > accessing the file through a Squid cache and that at the > time (Zope 2.0.1) there was a legitimate bug in the way > that "If-Modified-Since" headers were handled. Squid was > actually returning the file to him. It should have been > marked completed quite a while ago (I just did that). > > I am using IE 5 (5.00.2314.1003), cache settings set to: > > "Check for newer versions of stored pages: > x Every visit to the page > > ...and I cannot reproduce the problem that you are > describing :( Are these your cache settings? Are you > accessing the server through any kind of proxy? > > Thanks I am using IE 5 (5.00.2919.6307), cache settings set to: "Check for newer versions of stored pages: Automatically Those settings should get the new file if it has changed. I am accessing the server through a proxy.. could that be a problem? I think it would be strange if everyone accessing the website I am building can see the new files.. What do you think? Peter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
RE: [Zope-dev] Cache-bug in handling of files
> I am using IE 5 (5.00.2919.6307), cache settings set to: > "Check for newer versions of stored pages: > Automatically > > Those settings should get the new file if it has changed. > > I am accessing the server through a proxy.. could that be a problem? I > think it would be strange if everyone accessing the website I am > building can see the new files.. > > What do you think? > > Peter Peter - I have done some testing here and I can demonstrate that this is an IE issue. I set my cache to "Automatically" like yours and restarted it. I then opened a Netscape and created a new file object. I instrumented the code in the 'index_html' method of File objects so that I could tell _for sure_ whether things were actually being called at the server or not. Here's what I did: - create a file 'myfile.txt', uploading a contents of text1.txt into it. - visit the view tab with IE. The server confirms that the index_html was called, and the whole content was sent, not a 304. - now (using netscape again) upload the contents of text2.txt into the file object. The mgmt screen correctly shows the updated byte length, etc. - click the 'view' tab again on IE. My instrumenting confirms that IE is not contacting the server *at all* no matter how many times I click the 'view' tab, and I keep seeing the old content. A look at the headers produced by this shows nothing that tells IE it should be doing that: HTTP/1.1 200 OK Server: Zope/(unreleased version) ZServer/1.1b1 Date: Fri, 11 Aug 2000 15:18:50 GMT Connection: close Content-Type: text/plain Content-Length: 944 Last-Modified: Fri, 11 Aug 2000 15:16:06 GMT Interestingly, if you open the "view" tab in a new window, you'll see the updated content. Now, using that same new window, set your cursor at the end of the url string in the url bar and hit return. IE seems to reload the page, but it is not actually even contacting the server. Stranger yet, if you click the "refresh" button it *will* contact the server (and it passes an If-Modified-Since header, and correctly gets a 304 Not Modified). Now, use netscape to change the content again. The whole thing starts over. Clicking the 'view' link on the page or pressing return in the URL bar will not even contact the server and the only way to get the updated content is to explicitly press "refresh" or open a new window, even though the resource returned no caching information one way or the other. I'm going to close that bug report and include this report for those who may find it useful in the future. Brian Lloyd[EMAIL PROTECTED] Software Engineer 540.371.6909 Digital Creations http://www.digicool.com ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Cache-bug in handling of files
since all the data at my corporate intranet site is pulled from a RDMS, all my refrence URLS are generated in JavaScript and have a rnd="a randomly generated number between 1 and a million" to force the browser to get the current page. __ Jim Sanford . Database Engineer / \ / Accelerated Technology, Inc. / / 720 Oak Circle Drive East / / \Mobile, AL 36609 / / \ Voice: 334-661-5770 fax: 334-661-5788 / \ E-Mail: [EMAIL PROTECTED] Web: http://www.atinucleus.com Nucleus. All You NEED in an RTOS. Royalty Free __ - Original Message - From: Brian Lloyd <[EMAIL PROTECTED]> To: 'Peter Arvidsson' <[EMAIL PROTECTED]>; Brian Lloyd <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, August 11, 2000 10:44 AM Subject: RE: [Zope-dev] Cache-bug in handling of files > I am using IE 5 (5.00.2919.6307), cache settings set to: > "Check for newer versions of stored pages: > Automatically > > Those settings should get the new file if it has changed. > > I am accessing the server through a proxy.. could that be a problem? I > think it would be strange if everyone accessing the website I am > building can see the new files.. > > What do you think? > > Peter Peter - I have done some testing here and I can demonstrate that this is an IE issue. I set my cache to "Automatically" like yours and restarted it. I then opened a Netscape and created a new file object. I instrumented the code in the 'index_html' method of File objects so that I could tell _for sure_ whether things were actually being called at the server or not. Here's what I did: - create a file 'myfile.txt', uploading a contents of text1.txt into it. - visit the view tab with IE. The server confirms that the index_html was called, and the whole content was sent, not a 304. - now (using netscape again) upload the contents of text2.txt into the file object. The mgmt screen correctly shows the updated byte length, etc. - click the 'view' tab again on IE. My instrumenting confirms that IE is not contacting the server *at all* no matter how many times I click the 'view' tab, and I keep seeing the old content. A look at the headers produced by this shows nothing that tells IE it should be doing that: HTTP/1.1 200 OK Server: Zope/(unreleased version) ZServer/1.1b1 Date: Fri, 11 Aug 2000 15:18:50 GMT Connection: close Content-Type: text/plain Content-Length: 944 Last-Modified: Fri, 11 Aug 2000 15:16:06 GMT Interestingly, if you open the "view" tab in a new window, you'll see the updated content. Now, using that same new window, set your cursor at the end of the url string in the url bar and hit return. IE seems to reload the page, but it is not actually even contacting the server. Stranger yet, if you click the "refresh" button it *will* contact the server (and it passes an If-Modified-Since header, and correctly gets a 304 Not Modified). Now, use netscape to change the content again. The whole thing starts over. Clicking the 'view' link on the page or pressing return in the URL bar will not even contact the server and the only way to get the updated content is to explicitly press "refresh" or open a new window, even though the resource returned no caching information one way or the other. I'm going to close that bug report and include this report for those who may find it useful in the future. Brian Lloyd[EMAIL PROTECTED] Software Engineer 540.371.6909 Digital Creations http://www.digicool.com ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope ) ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Cache-bug in handling of files
So there is nothing else I can do but to make my files open in a new window then... But what I dont understand is why IE doesnt send any If-Modified-Since header? Shouldnt it always do that if the settings are not set to never update cached files? Peter Jim Sanford skrev: > > since all the data at my corporate intranet site is pulled from a RDMS, all my >refrence URLS are generated in JavaScript and have a > rnd="a randomly generated number between 1 and a million" to force the browser to >get the current page. > > __ > > Jim Sanford > . Database Engineer > / \ / Accelerated Technology, Inc. > / / 720 Oak Circle Drive East >/ / \Mobile, AL 36609 > / / \ Voice: 334-661-5770 fax: 334-661-5788 > / \ E-Mail: [EMAIL PROTECTED] > Web: http://www.atinucleus.com > > Nucleus. All You NEED in an RTOS. Royalty Free > __ > > - Original Message - > From: Brian Lloyd <[EMAIL PROTECTED]> > To: 'Peter Arvidsson' <[EMAIL PROTECTED]>; Brian Lloyd <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Friday, August 11, 2000 10:44 AM > Subject: RE: [Zope-dev] Cache-bug in handling of files > > > I am using IE 5 (5.00.2919.6307), cache settings set to: > > "Check for newer versions of stored pages: > > Automatically > > > > Those settings should get the new file if it has changed. > > > > I am accessing the server through a proxy.. could that be a problem? I > > think it would be strange if everyone accessing the website I am > > building can see the new files.. > > > > What do you think? > > > > Peter > > Peter - I have done some testing here and I can demonstrate > that this is an IE issue. > > I set my cache to "Automatically" like yours and restarted > it. I then opened a Netscape and created a new file object. > I instrumented the code in the 'index_html' method of File > objects so that I could tell _for sure_ whether things were > actually being called at the server or not. Here's what I > did: > > - create a file 'myfile.txt', uploading a contents of > text1.txt into it. > > - visit the view tab with IE. The server > confirms that the index_html was called, and the whole > content was sent, not a 304. > > - now (using netscape again) upload the contents of > text2.txt into the file object. The mgmt screen > correctly shows the updated byte length, etc. > > - click the 'view' tab again on IE. My instrumenting > confirms that IE is not contacting the server *at all* > no matter how many times I click the 'view' tab, and I > keep seeing the old content. A look at the headers > produced by this shows nothing that tells IE it should > be doing that: > > HTTP/1.1 200 OK > Server: Zope/(unreleased version) ZServer/1.1b1 > Date: Fri, 11 Aug 2000 15:18:50 GMT > Connection: close > Content-Type: text/plain > Content-Length: 944 > Last-Modified: Fri, 11 Aug 2000 15:16:06 GMT > > Interestingly, if you open the "view" tab in a new window, > you'll see the updated content. Now, using that same new > window, set your cursor at the end of the url string in the > url bar and hit return. IE seems to reload the page, but it > is not actually even contacting the server. Stranger yet, if > you click the "refresh" button it *will* contact the server > (and it passes an If-Modified-Since header, and correctly > gets a 304 Not Modified). > > Now, use netscape to change the content again. The whole thing > starts over. Clicking the 'view' link on the page or pressing > return in the URL bar will not even contact the server and > the only way to get the updated content is to explicitly press > "refresh" or open a new window, even though the resource > returned no caching information one way or the other. > > I'm going to close that bug report and include this report > for those who may find it useful in the future. > > Brian Lloyd[EMAIL PROTECTED] > Software Engineer 540.371.6909 > Digital Creations http://www.digicool.com > > ___ > Zope-Dev maillist - [EMAIL PROTECTED] > http://lists.zope.org/mailman/listinfo/zope-dev > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce
Re: [Zope-dev] Cache-bug in handling of files
On Mon, 14 Aug 2000 10:01:03 +0200, Peter Arvidsson <[EMAIL PROTECTED]> wrote: >So there is nothing else I can do but to make my files open in a new >window then... > >But what I dont understand is why IE doesnt send any If-Modified-Since >header? Shouldnt it always do that if the settings are not set to never >update cached files? Browser dont spontaneously generate If-Modified-Since - only if you include a Last-Modified header in the original response (Im not entirely sure whether or not they are allowed to) Note that Brian was observing that IE was not sending any request to the server - any request (even one that includes cache control headers) is going to involve a performance hit. Brian: could you repeat your test including the header cache-control: must-revalidate This certainly *should* have the desired effect of not letting IE display stale data. Ive covered the use of this header in some detail in a recent HowTo: http://www.zope.org/Members/htrd/howto/caching Toby Dickenson [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )