A Caching Issue - I Suspect

Discussion in 'ASP .Net' started by Smithers, Feb 8, 2005.

  1. Smithers

    Smithers Guest

    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!
     
    Smithers, Feb 8, 2005
    #1
    1. Advertising

  2. Smithers

    Joerg Jooss Guest

    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:
     
    Joerg Jooss, Feb 9, 2005
    #2
    1. Advertising

  3. Smithers

    Smithers Guest

    <<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" <> 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:
     
    Smithers, Feb 10, 2005
    #3
  4. Smithers

    Frank Buchan Guest

    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!
    >
     
    Frank Buchan, Feb 11, 2005
    #4
  5. Smithers

    Win, Pats Guest

    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!
    >>

    >
    >
     
    Win, Pats, Feb 11, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GO
    Replies:
    4
    Views:
    520
  2. Eric
    Replies:
    1
    Views:
    477
    bruce barker
    Nov 26, 2003
  3. Selen

    sqlserver database suspect

    Selen, Jan 29, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    698
    =?Utf-8?B?RWR3YXJk?=
    Jan 29, 2004
  4. comcast

    1.1 com interface (I suspect)

    comcast, Jun 22, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    356
    Ray Booysen
    Jun 22, 2006
  5. comcast
    Replies:
    2
    Views:
    329
    comcast
    Jun 22, 2006
Loading...

Share This Page