Page 291 - DCAP312_WEB_TECHNOLOGIES_II
P. 291

Unit 14: Debugging and Optimization



             insert funny cat pictures to illustrate their point, the said cat pictures might be served from   Notes
             a non SSL host. This will cause a nagging mixed content warning from the browser. Camo
             is basically an SSL image proxy that solves the issue. See more on this blog post. Note that
             one of the 2 images is taking 7 seconds to load.
             Solutions

             We have about 1,000KB of images. A common practice is to compress and optimize images.
             There are a lot of tools out there for that purpose. WebPagetest performance review tab
             estimates that some of the images can be compressed and save about 40KB. Note that it does
             not include one of the largest images, which is a animated gif proxied through Camo. I sent
             the gif to Smush.it and it came back 50KB lighter. Bottom line: potential savings would be
             around 10%. Compressing images might not be easily achievable. I do not think it would
             be a good idea to compress them on the fly (it would take some extra CPU resources to do
             that through Camo for instance). A better approach might be to have the image compressed
             at the source (in the case of Gravatar, when a user uploads an avatar). That would probably
             require a significant effort and I am not sure it will be worth the gain.
             An alternative could be to implement asynchronous image loading. When we first load the
             GitHub page, none of that content is visible (all the images are below the fold). Knowing
             that, the HTML page could be generated with a placeholder for the image which would be
             loaded later on via javascript. The javascript could be listening for scroll events and monitor
             the visibility of the images in order to decide when to load them. Pamela Fox wrote about that
             not long ago. We can also see the technique in action on Meetup’s website (for instance visit
             this meetup page and look at the sidebar with the list of attendees while we scroll). Note that
             for users browsing with javascript disabled, they would miss the images. I am not sure that
             would be a deal breaker as I am assuming most of GitHub users have javascript turned on.
             Questions

             1. How do reduce the size downloads?
             2. Describe the javascript and html.
            Self Assessment Questions

               6.  The SDK …………… that comes along with .NET SDK can be found in the Guidebook
                 directory.
                 (a)  compiler                   (b)  debugger

                 (c)  interpreter                (d)  None of these.
               7.  ……………. debugging is another technique to debug a program that is started outside
                 of Visual Studio.
                 (a)  Just-In-Time               (b)  Just-on-Time
                 (c)  Just-out-Time              (d)  None of these.

               8.  ASP.NET is a web application framework developed by Microsoft to allow programmers
                 to build ………………. web sites and web applications.
                 (a)  static                     (b)  static and dynamic both
                 (c)  dynamic                    (d)  None of these.

               9.  The ASP.NET model provides a number of ………………………… formance enhancements
                 that are not included in earlier versions of ASP.
                 (a)  built-in                   (b)  built-out
                 (c)  functions                  (d)  None of these.


                                             LOVELY PROFESSIONAL UNIVERSITY                                   285
   286   287   288   289   290   291   292   293   294