> Forums > Active Social > Feedback and Requests > Add client caching to profilepic image handler
Last Post 12 Oct 2010 03:00 PM by R1ckJon3z. 10 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Informative
Smart-Thinker
Customers
Smart-Thinker
Post Count:546

--
07 Jun 2010 01:29 PM
    Hi Will,

    I recently updated my image handlers to implement client caching (by adding an Expires time to the response) and it massively improves performance and boosts the page speed in YSlow and Google PageSpeed in FireBug.

    It would be nice if this could make it into your profilepic.ashx handler too so I could switch - it's only a few lines of code and is a massive performance boost.

    context.Response.Cache.SetExpires (DateTime.Now.Add(timespan)); context.Response.Cache.SetCacheability(HttpCacheability.Public);
    context.Response.Cache.SetValidUntilExpires(false);


    Here are some threads that were useful:

    http://www.codeproject.com/KB/aspne...SPNET.aspx
    http://dotnetslackers.com/articles/...P-NET.aspx  (also sets a disk cache)
    http://www.furrygoat.com/2003/04/21...-and-etag/       (example of how to check and set etag)
    http://code.msdn.microsoft.com/ResourceCache       (example of how to check and set etag and see if the image has changed)
    thanks
    Rodney Joyce
    PokerDIY.com - Connecting Poker Players
    Will Morgenweck Forum Admin
    DotNetNuke Staff
    Will Morgenweck
    Post Count:7672

    --
    07 Jun 2010 01:49 PM
    Rodney,
    Our profile picture handler already handles caching
    Will Morgenweck
    Director of Product Management
    DotNetNuke Corp.
    Smart-Thinker
    Customers
    Smart-Thinker
    Post Count:546

    --
    07 Jun 2010 02:16 PM
    Is it turned on on this site or how do you configure it?

    http://www.activemodules.com/deskto...&h=75&w=75

    does not show the Expires in the response headers (I am using Firebug/Yslow) and the browser is requesting it each time?
    thanks
    Rodney Joyce
    PokerDIY.com - Connecting Poker Players
    Will Morgenweck Forum Admin
    DotNetNuke Staff
    Will Morgenweck
    Post Count:7672

    --
    07 Jun 2010 02:39 PM
    I'll check again when I get back in town. We did all testing using fiddler. When used in the the context of a page request you see that it was being chard properly.
    Will Morgenweck
    Director of Product Management
    DotNetNuke Corp.
    Smart-Thinker
    Customers
    Smart-Thinker
    Post Count:546

    --
    07 Jun 2010 02:45 PM
    Ok - even when I do a YSlow on this member list page (http://www.activesocial.com/members.aspx) they are all flagged as missing the Expires tag, but that's cool if you aware of it, thanks (my page scores are horrific on PokerDIY and trying to make some performance gains)
    thanks
    Rodney Joyce
    PokerDIY.com - Connecting Poker Players
    Smart-Thinker
    Customers
    Smart-Thinker
    Post Count:546

    --
    13 Jul 2010 01:00 PM
    I checked AS 1.7.1 and can confirm that this has been fixed - thanks.
    thanks
    Rodney Joyce
    PokerDIY.com - Connecting Poker Players
    Will Morgenweck Forum Admin
    DotNetNuke Staff
    Will Morgenweck
    Post Count:7672

    --
    13 Jul 2010 01:03 PM
    Unfortunately we are seeing too many support tickets about profile pictures not being updated. AS 1.7.2 will turn the image caching off by default but also include an option to turn it back on.
    Will Morgenweck
    Director of Product Management
    DotNetNuke Corp.
    Smart-Thinker
    Customers
    Smart-Thinker
    Post Count:546

    --
    13 Jul 2010 01:26 PM
    Ok, thats sounds fine, thanks.
    thanks
    Rodney Joyce
    PokerDIY.com - Connecting Poker Players
    Smart-Thinker
    Customers
    Smart-Thinker
    Post Count:546

    --
    16 Jul 2010 01:15 AM
    Out of interest: this made a massive difference to my YSlow score on the PokerDIY homepage - on 1.6.1 it was 65 (it used to be 50 before I went on my crusade - now on 1.7.2 it has jumped automatically to 70 with the user pic caching - I suppose a lot of people didn't even know about it, but it's good!

    Member list views are a lot faster on the 2nd hit (and much better Yslow score). With regards to users complaining about caching images - I think user expectation control is required here - more blurb on how to hard-refresh their browser on the image edit page etc. the benefits are far greater IMHO.
    thanks
    Rodney Joyce
    PokerDIY.com - Connecting Poker Players
    Matt Marlor
    Customers
    Matt Marlor
    Post Count:375

    --
    24 Jul 2010 10:17 AM
    I have actually gone to the step of adding the blurb on doing a reload on the profilepic page.
    AuTechHeads - An Australian group for geeks. Visit us at http://www.autechheads.com!
    R1ckJon3z
    Customers
    R1ckJon3z
    Post Count:116

    --
    12 Oct 2010 03:00 PM
    Where is the caching setting located?  I didn't see it in the control panel.  I am using 1.8.2 and it appears that my profile pic images are being cached.  Just curious to see what my setting is....
    Poker Sharkz
    Ricky Jones | PokerSharkz.net | Social Networking For Poker Players
    You are not authorized to post a reply.
    > Forums > Active Social > Feedback and Requests > Add client caching to profilepic image handler
    test
    Copyright 2012 by DotNetNuke Corporation / Terms of Use / Privacy