1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Cache CFimage

Discussion in 'Programming' started by timbad2021, Nov 4, 2010.

  1. #1
    I want to cache the thumbs because the images I am resizing are around 1-3 MBs each and it takes forever to load a page of thumbnails so I want to cache the thumbnails. Is this possible or do I need to take a new approach? Thanks!

    Below is my current code:
    <cfimage action="read" source="#dir.DIRECTORY#\#dir.name#" name="ImageObject" />
    <cfimage action="resize" source="#ImageObject#"	width="115" height="89" name="ImageObject" />
    <cfimage action="writetobrowser" source="#ImageObject#" style="margin-right:4px;" />
    Code (markup):

     
    timbad2021, Nov 4, 2010 IP
  2. Daoud_Alpha

    Daoud_Alpha Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It is a point of weakness of client side
    I was on this topic for 2 weeks, before publishing my web site
    I had the same problem
    Conclusion:
    In server side u can do every thing, but not before uploading image
    In client side that’s possible (u can resize, rotate….. image before uploading) but u have to use some technique that maybe doesn’t exist on every client computer its Flash 10 (Flash cs4, flex, Action script 3) its very simple, very fast and smart and resolve the problem, but the only problem that maybe not all ur client have Flash 10 on their computer
    I am sorry I cant put links because I am new to this forum but its very simple just do search with : Ady Levy client side image resize flash cs4
     
    Daoud_Alpha, Dec 15, 2010 IP
  3. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Dont' resize on every request. Create a separate thumbnail version when the images are uploaded.

    <cfimage action="writetobrowser" source="/path/to/thumbnailVersionOfYourImage.png" style="margin-right:4px;" />
     
    cfStarlight, Dec 15, 2010 IP
  4. fardesi

    fardesi Peon

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hmm... also don't use <cfimage> to resend the content... once you have written to disk... use the <img> tag... also... if you have your own server... and have bit of knowledge... I recommend... Apache with Mod_perl and Apache::ImageMagick module... to do the dynamic resize for you...
     
    fardesi, Jan 18, 2011 IP
  5. prptl709

    prptl709 Guest

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    What is mean bye cache image I didn't get the explanation.
     
    prptl709, Feb 25, 2011 IP