Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tony Kiernan 278 posts 341 karma points
    Nov 08, 2011 @ 13:42
    Tony Kiernan
    0

    Clear Cache?

    During development I output a version of an image at full size using imagegen.  Now I'm putting the images (part of a gallery) out at the right size, ImageGen keeps creating the full size one as well as the correct size.  If I delete the cached folder and set nocache to true, it works fine.  As soon as I put caching back on it recreates the full size version.

    Is there something I need  to clear as well as the folder in the media directory?

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Nov 08, 2011 @ 13:46
    Douglas Robar
    0

    That's very odd and I'm not sure how it might be happening since with or without the &nocache=true parameter the same requests are sent to ImageGen and the same cached images will be created. It's just that with the &nocache=true parameter you will end up recreating the cached image even if an identical one already exists on the disk. So really there's no reason to see a difference because of that parameter, except the server's performance will be lowered with &nocache=true enabled.

    As a wild and crazy idea... delete the cached folders and also recycle the site's application pool to forcibly clear any in-memory information ImageGen keeps for performance. 

    Let me know how you get on.

    cheers,
    doug. 

  • Tony Kiernan 278 posts 341 karma points
    Nov 08, 2011 @ 15:03
    Tony Kiernan
    0

    No joy. I've tried re-adding the images and I was getting a similar issue with the first in the cycle (I'm pulling all images from a folder to make a gallery).  So perhaps the issue is at this end - although there is nothing in the code that could be causing this (it's replicated elsewhewre with no problem).  I've over written the wrong sized cached image with the correct one and guess that'll do for now

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Nov 08, 2011 @ 15:07
    Douglas Robar
    0

    Any chance you could share a url (and possibly provide read-only rdp or ftp access) so I can see it happening? I might spot something. If so, just contact me through my website at http://www.percipientstudios.com/about/contact.aspx

    Another question... are you running in a load-balanced environment?

    cheers,
    doug. 

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Nov 08, 2011 @ 16:31
    Douglas Robar
    1

    Thanks, Tony, for the email with a link. Here's what I've found out.

     

    The page's source code has this:
    <divclass="slides_container">
      <img src="/ImageGen.ashx?image=/media/208824/CORE FALL HOLIDAY 2011 1205.jpg&width=720" alt="CORE FALL HOLIDAY 2011 1205" />
      <img src="/ImageGen.ashx?image=/media/208829/CORE FALL HOLIDAY 2011 1246.jpg&width=720" alt="CORE FALL HOLIDAY 2011 1246" />
      <img src="/ImageGen.ashx?image=/media/208834/CORE FALL HOLIDAY 2011 1287.jpg&width=720" alt="CORE FALL HOLIDAY 2011 1287" />
      <img src="/ImageGen.ashx?image=/media/208839/CORE FALL HOLIDAY 2011 584.jpg&width=720" alt="CORE FALL HOLIDAY 2011 584" />
      </div>
    But, when I use chrome's inspector I get a different result for one of the images and when I view that image it is a 5176px wide and not 720 wide you thought you were requesting at all. Here's what the inspector sees:
    <img src="/ImageGen.ashx?image=/media/208824/CORE FALL HOLIDAY 2011 1205.jpg&amp;width=720?1320764593605" alt="CORE FALL HOLIDAY 2011 1205" style="position: absolute; top: 0px; display: block; left: 0px; z-index: 5; ">
    Notice the question mark in the width parameter. That makes the width value bogus and since you didn't specify any other ImageGen parameters it sends back the image at its original size.
    The question is... what about your site is appending the ?1320764593605 to the first img's url?

     

    Turns out it is a bug (or "feature") in the slidejs library you're using, as you can see if you inspect their sample pages at http://slidesjs.com/

    So... the solution is to fix the way slidejs appends to the querystring.
    But the workaround... is to add another, bogus parameter to your ImageGen urls. Then when slidejs adds its faulty querystring it won't get in your way.
    Perhaps something like this:
    <img src="/ImageGen.ashx?image=/media/208824/CORE FALL HOLIDAY 2011 1205.jpg&amp;width=720&amp;bogus=?1320766052883" alt="CORE FALL HOLIDAY 2011 1205" style="position: absolute; top: 0px; left: 0px; display: none; z-index: 0; ">

     

    cheers,
    doug. 

  • Tony Kiernan 278 posts 341 karma points
    Nov 08, 2011 @ 17:08
    Tony Kiernan
    0

    It's all happy now.  Thank you very much for your help, Doug

Please Sign in or register to post replies

Write your reply to:

Draft