Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > A Caching Issue - I Suspect

Reply
Thread Tools

A Caching Issue - I Suspect

 
 
Smithers
Guest
Posts: n/a
 
      02-08-2005
My ASP.NET app enables users to upload photos - after which they can
optionally rotate the photo (90 degrees to the left or right). They just
click a link that causes a postback, and server-side code then manipulates
the image file - after which the aspx page refreshes on the client, showing
the rotated version of the photo.

In testing I have observed that sometimes the image will in fact get rotated
(on the server), but the aspx page in the client will refresh but will not
show the current version of the photo.

Here is a typical test scenario with a test client running XP/Pro/SP2 IE6
connecting to separate Windows Server 2003/IIS6 in a data center accessible
via the Internet (i.e., this testing happens over the Internet):
1. Upload a photo. The aspx page shows original photo. This is good.
2. Click to rotate the photo 90 to the right. The aspx page shows the photo
rotated 90 to the right. This is good.
3. Click again to rotate the photo 90 to the right. The aspx shows the photo
rotated 90 from original, NOT 180 degrees as is saved on the server. The
photo should be upside-down at this point and it's not. This is not good.
4. At this point I can click to rotate the photo 90 degrees right or left -
and the aspx page continues to show it rotated 90 to the right - which was
the very first rotation (in step 2). After every rotation request sent from
the browser, I have verified that the image does, in fact, get rotated. I
verify this by viewing the image directly on/from the server (not through
the browser).

I suspected that the image was getting cached on the test client - but
purging the cache has no effect; rebooting the client has no effect, etc.
The only thing that seems to actually result in the current version of the
rotated photo showing up in the browser is waiting - about 10 minutes or so.

FWIW: the aspx has this at the top:<%@ OutputCache Location="none" %>

Any ideas for where the images are getting cached? What I need is the
ability to rotate the photos in any direction, any number of times during a
session, and have the current version show up in the browser.

Thanks!


 
Reply With Quote
 
 
 
 
Joerg Jooss
Guest
Posts: n/a
 
      02-09-2005
Smithers wrote:

> My ASP.NET app enables users to upload photos - after which they can
> optionally rotate the photo (90 degrees to the left or right). They
> just click a link that causes a postback, and server-side code then
> manipulates the image file - after which the aspx page refreshes on
> the client, showing the rotated version of the photo.
>
> In testing I have observed that sometimes the image will in fact get
> rotated (on the server), but the aspx page in the client will refresh
> but will not show the current version of the photo.
>
> Here is a typical test scenario with a test client running XP/Pro/SP2
> IE6 connecting to separate Windows Server 2003/IIS6 in a data center
> accessible via the Internet (i.e., this testing happens over the
> Internet): 1. Upload a photo. The aspx page shows original photo.
> This is good. 2. Click to rotate the photo 90 to the right. The aspx
> page shows the photo rotated 90 to the right. This is good.
> 3. Click again to rotate the photo 90 to the right. The aspx shows
> the photo rotated 90 from original, NOT 180 degrees as is saved on
> the server. The photo should be upside-down at this point and it's
> not. This is not good. 4. At this point I can click to rotate the
> photo 90 degrees right or left - and the aspx page continues to show
> it rotated 90 to the right - which was the very first rotation (in
> step 2). After every rotation request sent from the browser, I have
> verified that the image does, in fact, get rotated. I verify this by
> viewing the image directly on/from the server (not through the
> browser).
>
> I suspected that the image was getting cached on the test client -
> but purging the cache has no effect; rebooting the client has no
> effect, etc. The only thing that seems to actually result in the
> current version of the rotated photo showing up in the browser is
> waiting - about 10 minutes or so.
>
> FWIW: the aspx has this at the top:<%@ OutputCache Location="none" %>
>
> Any ideas for where the images are getting cached? What I need is the
> ability to rotate the photos in any direction, any number of times
> during a session, and have the current version show up in the browser.


I agree that this has to be a caching issue. Try using a HTTP debugger
like Fiddler (www.fiddlertool.com) to check whether your browser really
still sends a new request once the image stops rotating.

Do you use GET or POST as HTTP method?

Cheers,
--
http://www.joergjooss.de
mailto:news-
 
Reply With Quote
 
 
 
 
Smithers
Guest
Posts: n/a
 
      02-10-2005
<<Do you use GET or POST as HTTP method?>>

POST: Here's how I initiate the postback via client-side JavaScript:
function RotateRight() {
__doPostBack('btnRotateRight','');
}

with btnRotateRight being a server-side method that rotates the photo by
using methods of System.Drawing.Image.





"Joerg Jooss" <news-> wrote in message
news...
> Smithers wrote:
>
>> My ASP.NET app enables users to upload photos - after which they can
>> optionally rotate the photo (90 degrees to the left or right). They
>> just click a link that causes a postback, and server-side code then
>> manipulates the image file - after which the aspx page refreshes on
>> the client, showing the rotated version of the photo.
>>
>> In testing I have observed that sometimes the image will in fact get
>> rotated (on the server), but the aspx page in the client will refresh
>> but will not show the current version of the photo.
>>
>> Here is a typical test scenario with a test client running XP/Pro/SP2
>> IE6 connecting to separate Windows Server 2003/IIS6 in a data center
>> accessible via the Internet (i.e., this testing happens over the
>> Internet): 1. Upload a photo. The aspx page shows original photo.
>> This is good. 2. Click to rotate the photo 90 to the right. The aspx
>> page shows the photo rotated 90 to the right. This is good.
>> 3. Click again to rotate the photo 90 to the right. The aspx shows
>> the photo rotated 90 from original, NOT 180 degrees as is saved on
>> the server. The photo should be upside-down at this point and it's
>> not. This is not good. 4. At this point I can click to rotate the
>> photo 90 degrees right or left - and the aspx page continues to show
>> it rotated 90 to the right - which was the very first rotation (in
>> step 2). After every rotation request sent from the browser, I have
>> verified that the image does, in fact, get rotated. I verify this by
>> viewing the image directly on/from the server (not through the
>> browser).
>>
>> I suspected that the image was getting cached on the test client -
>> but purging the cache has no effect; rebooting the client has no
>> effect, etc. The only thing that seems to actually result in the
>> current version of the rotated photo showing up in the browser is
>> waiting - about 10 minutes or so.
>>
>> FWIW: the aspx has this at the top:<%@ OutputCache Location="none" %>
>>
>> Any ideas for where the images are getting cached? What I need is the
>> ability to rotate the photos in any direction, any number of times
>> during a session, and have the current version show up in the browser.

>
> I agree that this has to be a caching issue. Try using a HTTP debugger
> like Fiddler (www.fiddlertool.com) to check whether your browser really
> still sends a new request once the image stops rotating.
>
> Do you use GET or POST as HTTP method?
>
> Cheers,
> --
> http://www.joergjooss.de
> mailto:news-



 
Reply With Quote
 
Frank Buchan
Guest
Posts: n/a
 
      02-11-2005
When you write the image to the page try making the src link in the format:

"image_name.jpg?t={current time}"

Obviously if it is a GIF file, a different extension, etc., is required.

It is a bit of a hack, but if you set the {current time} to the second you
will get a pretty much unique value. The page will then force load the
image. It works consistently, and as far as I know circumvents evens mart
caching on the client-side because the src is considered new due to the
query string portion. It adds a few bytes to the return, but I suspect that
is a small price to pay.

F Buchan



"Smithers" <> wrote in message
news:...
> My ASP.NET app enables users to upload photos - after which they can
> optionally rotate the photo (90 degrees to the left or right). They just
> click a link that causes a postback, and server-side code then manipulates
> the image file - after which the aspx page refreshes on the client,
> showing the rotated version of the photo.
>
> In testing I have observed that sometimes the image will in fact get
> rotated (on the server), but the aspx page in the client will refresh but
> will not show the current version of the photo.
>
> Here is a typical test scenario with a test client running XP/Pro/SP2 IE6
> connecting to separate Windows Server 2003/IIS6 in a data center
> accessible via the Internet (i.e., this testing happens over the
> Internet):
> 1. Upload a photo. The aspx page shows original photo. This is good.
> 2. Click to rotate the photo 90 to the right. The aspx page shows the
> photo rotated 90 to the right. This is good.
> 3. Click again to rotate the photo 90 to the right. The aspx shows the
> photo rotated 90 from original, NOT 180 degrees as is saved on the server.
> The photo should be upside-down at this point and it's not. This is not
> good.
> 4. At this point I can click to rotate the photo 90 degrees right or
> left - and the aspx page continues to show it rotated 90 to the right -
> which was the very first rotation (in step 2). After every rotation
> request sent from the browser, I have verified that the image does, in
> fact, get rotated. I verify this by viewing the image directly on/from the
> server (not through the browser).
>
> I suspected that the image was getting cached on the test client - but
> purging the cache has no effect; rebooting the client has no effect, etc.
> The only thing that seems to actually result in the current version of the
> rotated photo showing up in the browser is waiting - about 10 minutes or
> so.
>
> FWIW: the aspx has this at the top:<%@ OutputCache Location="none" %>
>
> Any ideas for where the images are getting cached? What I need is the
> ability to rotate the photos in any direction, any number of times during
> a session, and have the current version show up in the browser.
>
> Thanks!
>



 
Reply With Quote
 
Win, Pats
Guest
Posts: n/a
 
      02-11-2005
Beautiful! Thanks!


"Frank Buchan" <> wrote in message
news:uHmxYe%...
> When you write the image to the page try making the src link in the
> format:
>
> "image_name.jpg?t={current time}"
>
> Obviously if it is a GIF file, a different extension, etc., is required.
>
> It is a bit of a hack, but if you set the {current time} to the second you
> will get a pretty much unique value. The page will then force load the
> image. It works consistently, and as far as I know circumvents evens mart
> caching on the client-side because the src is considered new due to the
> query string portion. It adds a few bytes to the return, but I suspect
> that is a small price to pay.
>
> F Buchan
>
>
>
> "Smithers" <> wrote in message
> news:...
>> My ASP.NET app enables users to upload photos - after which they can
>> optionally rotate the photo (90 degrees to the left or right). They just
>> click a link that causes a postback, and server-side code then
>> manipulates the image file - after which the aspx page refreshes on the
>> client, showing the rotated version of the photo.
>>
>> In testing I have observed that sometimes the image will in fact get
>> rotated (on the server), but the aspx page in the client will refresh but
>> will not show the current version of the photo.
>>
>> Here is a typical test scenario with a test client running XP/Pro/SP2 IE6
>> connecting to separate Windows Server 2003/IIS6 in a data center
>> accessible via the Internet (i.e., this testing happens over the
>> Internet):
>> 1. Upload a photo. The aspx page shows original photo. This is good.
>> 2. Click to rotate the photo 90 to the right. The aspx page shows the
>> photo rotated 90 to the right. This is good.
>> 3. Click again to rotate the photo 90 to the right. The aspx shows the
>> photo rotated 90 from original, NOT 180 degrees as is saved on the
>> server. The photo should be upside-down at this point and it's not. This
>> is not good.
>> 4. At this point I can click to rotate the photo 90 degrees right or
>> left - and the aspx page continues to show it rotated 90 to the right -
>> which was the very first rotation (in step 2). After every rotation
>> request sent from the browser, I have verified that the image does, in
>> fact, get rotated. I verify this by viewing the image directly on/from
>> the server (not through the browser).
>>
>> I suspected that the image was getting cached on the test client - but
>> purging the cache has no effect; rebooting the client has no effect, etc.
>> The only thing that seems to actually result in the current version of
>> the rotated photo showing up in the browser is waiting - about 10 minutes
>> or so.
>>
>> FWIW: the aspx has this at the top:<%@ OutputCache Location="none" %>
>>
>> Any ideas for where the images are getting cached? What I need is the
>> ability to rotate the photos in any direction, any number of times during
>> a session, and have the current version show up in the browser.
>>
>> Thanks!
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable page caching without disabling caching of jpegs andstylesheets etc JimLad ASP .Net 3 01-21-2010 10:13 AM
DNS problem, suspect PIX conf grzybek Cisco 5 02-02-2004 05:12 PM
Fragment Caching inside page caching? Troy Simpson ASP .Net 0 01-19-2004 11:57 AM
perl program no longer working in Win2k....suspect some form of system corruption... GO Perl 4 10-22-2003 12:45 AM
trouble with caching or caching the trouble Hypo ASP .Net 6 08-01-2003 07:11 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57