{"id":3667,"date":"2012-04-12T00:36:49","date_gmt":"2012-04-12T00:36:49","guid":{"rendered":"http:\/\/help-o.ning.com\/?p=3667"},"modified":"2019-09-06T05:50:09","modified_gmt":"2019-09-06T05:50:09","slug":"optimize-your-main-page","status":"publish","type":"post","link":"https:\/\/www.ning.com\/help\/optimize-your-main-page\/","title":{"rendered":"Optimize Your Main Page"},"content":{"rendered":"<p>By now you&#8217;ve added\u00a0<a href=\"https:\/\/www.ning.com\/help\/equip-yourself-with-the-right-diagnostic-tools\/\">diagnostic tools for your Ning Network<\/a>\u00a0and you&#8217;ve pinpointed those components on the main page that are weighing it down. You&#8217;ve also calculated your main page&#8217;s total weight &#8211; its size in KB. Now it&#8217;s time to optimize performance and\u00a0<strong>trim your main page down to a maximum of 500 KB<\/strong>.<\/p>\n<h3 id=\"image_diet\">PICK YOUR FAVORITE ONE OR TWO EMBEDS AND TRIM THE REST.<\/h3>\n<p>Text boxes make it easy to embed 3rd-party services, custom apps, and other content on your Ning Network. These include YouTube videos, flash games, Twitter feeds, advertisements, PollDaddy widgets, and just about anything else you can think of.<\/p>\n<p>While this embedded content can add flavor to your Ning Network, you should have no more than 1 or 2 on your main page an any time. Here&#8217;s why:<\/p>\n<ol>\n<li><strong>Your main page will only load as fast as your slowest embed<\/strong>. An embed that is slow or unavailable can block or severely delay the rest of your main page from loading.<\/li>\n<li><strong>Embeds are like small applications<\/strong>. If your embeds are not well-written, they will quickly use up the limited resources in your browser. This noticably slows things down and can even cause your browser to crash.<\/li>\n<li><strong>Even beautifully written embeds are very heavy<\/strong>. A single flash player from a third party can add 100K to the weight of your main page.\u00a0Use YSlow\u00a0to pinpoint the most cumbersome embeds.<\/li>\n<\/ol>\n<p>For every embed on your main page, you should ask yourself how much value it will add to\u00a0the member experience. If it&#8217;s critical, great. But if it is just nice to have, it\u2019s best to remove it. You can always keep a healthy rotation of main page widgets to keep things fresh. You can also take a screenshot of an embedded application or widget, and hyperlink the screenshot to the embed itself on a separate page. This keeps things visually interesting without adding much weight to your main page.<\/p>\n<h3 id=\"image_diet\">TRIM YOUR IMAGES DOWN TO SIZE.<\/h3>\n<p>In general, the images on your main page will take up between 1\/3 to 1\/2 of the total page size &#8211; you can get the exact figure for your main page with the Statistics tab in YSlow. The good news is that there are simple ways to optimize image size without sacrificing quality. And this doesn&#8217;t require expensive software &#8211; you can use free image editors like\u00a0<a href=\"http:\/\/seashore.sourceforge.net\/The_Seashore_Project\/About.html\" target=\"_blank\" rel=\"nofollow\">Seashore<\/a>,\u00a0Skitch, or\u00a0<a href=\"https:\/\/www.gimp.org\/\" target=\"_blank\" rel=\"noopener noreferrer\" rel=\"nofollow\">Gimp<\/a>.<\/p>\n<p>A good place to start is with images that always appear on your main page &#8211; like the header, background image, side images, and any custom module headers &#8211; and put them on the following diet:<\/p>\n<p><strong>Don&#8217;t scale images with HTML, resize them.<\/strong>\u00a0If your original image is larger than the space it actually occupies on the page, it will be automatically rescaled. This rescaling process doesn&#8217;t actually shrink the image size, and adds needless weight to your main page. In your image editor, resize your image so that its dimensions are exactly what you need for the main page. In the example below,\u00a0<strong>resizing the image makes it 6x smaller<\/strong>.<\/p>\n<div><img loading=\"lazy\" class=\"alignnone wp-image-3668\" title=\"dimension_example1\" src=\"\/help\/wp-content\/uploads\/dimension_example1.jpg\" alt=\"Optimize Your Main Page 1\" width=\"200\" height=\"200\" \/>Scaled 600&#215;600 image (62kb)<\/div>\n<div><img loading=\"lazy\" class=\"alignnone wp-image-3669 size-full\" title=\"dimension_example2\" src=\"https:\/\/www.ning.com\/help\/wp-content\/uploads\/dimension_example2.jpg\" alt=\"Optimize Your Main Page 2\" width=\"200\" height=\"200\" \/>Unscaled 200&#215;200 image (10kb)<\/div>\n<p><strong>Your images don&#8217;t need to be print quality.<\/strong>\u00a0Consider converting your image to an 8-bit PNG, medium-quality GIF, or medium-quality JPG. This usually doesn&#8217;t have a noticeable impact on your image. Likewise, if you&#8217;re using a PNG or GIF format, you can even restrict the color palette for your image in most cases as well. When restricting your color palette, try starting with the least number of colors possible and increase the colors incrementally as needed. Unless your image is a detailed photograph or artwork, you can often use a fairly limited color palette (32 colors or 256 colors) and still get great results. In the example below, we took a very detailed JPG image and converted it to a medium quality JPG. This made it\u00a0<strong>over 6x smaller<\/strong>.<\/p>\n<div><img loading=\"lazy\" class=\"alignnone wp-image-3671 size-full\" title=\"quality_example1\" src=\"https:\/\/www.ning.com\/help\/wp-content\/uploads\/quality_example1.jpg\" alt=\"Optimize Your Main Page 3\" width=\"200\" height=\"200\" \/>Original JPG image (54kb)<\/div>\n<div><img loading=\"lazy\" class=\"alignnone wp-image-3672 size-full\" title=\"quality_example2\" src=\"https:\/\/www.ning.com\/help\/wp-content\/uploads\/quality_example2.jpg\" alt=\"Optimize Your Main Page 4\" width=\"200\" height=\"200\" \/>Medium-quality JPG (8kb)<\/div>\n<p><strong>Eliminate whitespace.<\/strong>\u00a0You want your images to be trim and blank space around the edges of your images is a waste of space. If you need to keep a certain amount of space around your images, you can easily add this in with CSS which takes less time to load. For more information on adding padding around your images using CSS, check out this\u00a0<a href=\"https:\/\/www.w3schools.com\/css\/css_padding.asp\" target=\"_blank\" rel=\"noopener noreferrer\" rel=\"nofollow\">page<\/a>.<\/p>\n<div><strong>Use YSlow&#8217;s built-in Smush.it tool.<\/strong>\u00a0This tool further optimizes images by removing unnecessary bytes from the image file. This great thing about this process is that it typically reduces file size by 20% (exact figures can be found with Smush.it), yet won&#8217;t affect the quality of an image. When you open up YSlow and access the &#8220;Components&#8221; tab, you&#8217;ll see an option to &#8220;Smush.it&#8221; in the Action column for images. Click the &#8220;Smush.it&#8221; link to compress your image. Compressing an image with Smush.it should be the last step you take to optimize your images. Anytime you resave or recompress an image with your image editor, you&#8217;ll want to run your image through Smush.it to ensure that it&#8217;s as small as possible.<\/div>\n<p><strong>Keep it local<\/strong>. Make sure that your images are hosted directly on your Ning Network whenever possible. If you&#8217;re using CSS or HTML that reference images hosted elsewhere, this will create unnecessary work for your browser as it tries to resolve DNS records and cookies. DNS lookups take anywhere 20-120 milliseconds each. During this time, the browsers can&#8217;t actually download anything from the domain where your images are hosted.<\/p>\n<h3 id=\"choose_display_options\">CHOOSE THE RIGHT DISPLAY OPTIONS FOR YOUR FEATURES.<\/h3>\n<p>Limiting\u00a0the number of\u00a0embeds and putting your images on a diet will go a long way. You can also control the display options for your features that appear on the main page. Limiting how many blog posts appear on the main page, choosing Title view instead of Detail view, and\u00a0having only 1-2 RSS and text boxes will greatly improve the speed and usability of your main page.<\/p>\n<p><strong>Pick\u00a0your favorite RSS and display it in\u00a0Title view.<\/strong>\u00a0RSS feeds, like other embedded content, will slow down the main page of your Ning Network. One way to speed things up is to simply have fewer RSS boxes on the main page. Another way is to click the &#8220;Edit&#8221; button on the RSS box and choose Titles Only\u00a0instead of Detail View in the &#8220;Display&#8221; drop-down menu. This is a great option when your RSS feed is media-rich and is pulling in photos or videos from an\u00a0outside website.<\/p>\n<p><strong>Don&#8217;t go all-out with blog posts.<\/strong>\u00a0You can display up to 20 blog posts on the main page, but doing so will impact the speed of your main page. Media-rich blog posts that contain photos, flash players, and custom widgets are hampering performance in the same way that embeds in text boxes do. Try displaying 5 or 10 blog posts, and consider displaying Featured blog posts only. That way, you have tight control over what blog posts will show up on the main page. And just like with RSS, you can choose to display Titles Only instead of Detail View to achieve the speediest results.<\/p>\n<p><strong>Think about what you&#8217;re putting inside your text boxes<\/strong>. Though you can add up to\u00a010 text boxes\u00a0to your main page, try keeping this number down to 2-3.\u00a0In these text boxes, try putting the most lightweight widgets, and lightweight HTML code to show awesome custom content while keeping your main page speedy.<\/p>\n<h3 id=\"minimize_css_js\">MINIMIZE CUSTOM CSS AND JAVASCRIPT.<\/h3>\n<p>As a Network Creator, you can add custom CSS in the Advanced tab of the Appearance page. You can also add custom CSS and JavaScript to the Analytics box. While these customizations are useful, it&#8217;s important to remember that they will load on every page on your Ning Network, including the main page. They also cannot be cached by browsers, which means your custom code will take the same time to load whether it&#8217;s the 1st ot 100th time someone is seeing your main page. Take a look at what you have in the Advanced tab of the Appearance page. If it&#8217;s CSS that might not be written perfectly, or might not even be doing anything, see if you can live without it. Likewise, peek inside the Analytics box. If it&#8217;s not Google Analytics tracking code,\u00a0do you need it?<\/p>\n<p>You should also check your JavaScript for errors. You can easily spot errors by loading your main page in a Firebug-enabled browser and check the bottom right hand corner of the browser window for a red error message.<\/p>\n<p>Network Creators who use a good amount of custom code will want to follow these advanced guidelines:<\/p>\n<ul>\n<li><strong>Use external files for your JavaScript and CSS<\/strong>\u00a0&#8211; By using external files for JavaScript and CSS, members will generally see quicker load times for your pages since these files are cached by most browsers and so only require the browser to load your code once (any required time to run your code is still added to subsequent page loads). Conveniently, CSS added to the Advanced Appearance tab of your Ning Network is automatically added to an external file that is called on every page. For JavaScript, you can call external files using the include statemtent shown below from any Textbox or from the Analytics box of your network.<\/li>\n<\/ul>\n<p><code>&lt;script language=\"JavaScript\" src=\"YOUR_JAVACSRIPT_FILE.js\"&gt;&lt;\/script&gt;<\/code><\/p>\n<ul>\n<li><strong>Make your CSS files short and efficient<\/strong>\u00a0&#8211; Making your CSS as short and efficient as possible will reduce the amount of data your browser needs to load. Here are a things to check for in your custom CSS.<\/li>\n<\/ul>\n<ol>\n<li>Validate your CSS using a CSS validator. You can validate your custom CSS by copy and pasting it to this\u00a0<a href=\"https:\/\/jigsaw.w3.org\/css-validator\/#validate_by_input\" target=\"_blank\" rel=\"noopener noreferrer\" rel=\"nofollow\">page<\/a>.<\/li>\n<li>Avoid redundant code that can be consolidated into fewer statements or are setting the same property over and over again.<\/li>\n<li>When calling images from your CSS try to make sure they&#8217;re hosted on the same domain or as few other domains as possible. This reduces the number of DNS lookups and requests that need to be performed.<\/li>\n<li>Combine background images such as icons with CSS sprites when possible. This lets your browser load a single image in place of dozens.<\/li>\n<li>Avoid CSS expressions that dynamically set properties. These expressions are constantly evaluated when your pages are rendered, scrolled, and resized. These frequent evaluations and subsequent visual adjustments generally take away from your member&#8217;s overall experience as things can appear jumpy and laggy.<\/li>\n<\/ol>\n<ul>\n<li><strong>Make your JavaScript files short and efficient<\/strong>\u00a0&#8211; Making your JavaScript short and efficient helps reduce the amount of data your browser needs to load and the time to fully render your page. Here are easy ways to improve the code on your pages.<\/li>\n<\/ul>\n<ol>\n<li>Limit the amount of 3rd party code you include on your page. Most of the time, you don&#8217;t have control over 3rd party JavaScript. The way it&#8217;s written and the effect it has on your main page&#8217;s speed is out of your control.<\/li>\n<li>Check for JavaScript errors. Anytime you add a piece of code to your network, be sure to check to see if you&#8217;ve introduced any errors on your main page. You can easily spot errors by loading your Ning Network in a Firebug-enabled browser and check the bottom right hand corner of the browser window for a red error message.<img loading=\"lazy\" class=\"alignnone wp-image-3676\" title=\"js_error\" src=\"\/help\/wp-content\/uploads\/js_error.png\" alt=\"Optimize Your Main Page 5\" width=\"585\" height=\"245\" \/>If you&#8217;ve already added several scripts to your network and you see a JavaScript error, the easiest way to isolate the issue is to temporarily remove or disable all your scripts and add each script back one at a time, testing as you go along.<\/li>\n<li>Test to see if your JavaScript has degraded the performance of your main page. Anytime you add a piece of code to your network, Load your network up in Yslow and check to see if there&#8217;s a significant change in page weight or load time.<img loading=\"lazy\" class=\"alignnone wp-image-3677\" title=\"yslow_info\" src=\"\/help\/wp-content\/uploads\/yslow_info.png\" alt=\"Optimize Your Main Page 6\" width=\"585\" height=\"245\" \/>If you&#8217;ve already added several scripts to your network, the easiest way to isolate the performance of each script is to disable all your scripts and add each script back one at a time, testing as you go along.<\/li>\n<li>Replace redundant code with functions. If you&#8217;re writing your own Javacript, and you find yourself writing the same code over and over again, you can probably replace the repetitive code with a function. For more information on writing functions, check out this\u00a0<a href=\"https:\/\/www.w3schools.com\/jS\/js_functions.asp\" target=\"_blank\" rel=\"noopener noreferrer\" rel=\"nofollow\">page<\/a>.<\/li>\n<li>Avoid long operations. If you&#8217;re writing your own Javascript, avoid things like nested loops and operations that will take an exponential amount of time to run. Especially as your Ning Network grows and the data that your code interacts with grows, efficient operations will help maintian your main page&#8217;s performance.<\/li>\n<li>Take advantage of JavaScript libraries. The\u00a0<a href=\"http:\/\/api.jquery.com\/\" target=\"_blank\" rel=\"noopener noreferrer\" rel=\"nofollow\">jQuery<\/a>\u00a0library is already available to you on your network. Take advantage of its prebuilt functionality for doing things like selecting, inserting, and manipulating elements on the page. Using libraries is useful for writing really short and efficient code.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>By now you&#8217;ve added\u00a0<a href=\"https:\/\/www.ning.com\/help\/equip-yourself-with-the-right-diagnostic-tools\/\">diagnostic tools for your Ning Network<\/a>\u00a0and you&#8217;ve pinpointed those components on the main page that are weighing it down. You&#8217;ve also calculated your main page&#8217;s total weight &#8211; its size in KB. Now it&#8217;s time to optimize performance and\u00a0trim your main page down to a maximum of 500 KB.<br \/>\nPICK YOUR FAVORITE ONE OR TWO EMBEDS AND TRIM THE REST.<br \/>\nText boxes make it easy to embed 3rd-party services, custom apps, and other content on your Ning Network. These include YouTube videos, flash games, Twitter feeds, advertisements, PollDaddy widgets, and just about anything else you can think of.<br \/>\nWhile this embedded content can add flavor to your Ning Network, you should have no more than 1 or 2 on your main page an any time. Here&#8217;s why:<\/p>\n<p>Your main page will only load as fast as your slowest embed. An embed that is slow or unavailable can block or severely delay the rest of your main page from loading.<br \/>\nEmbeds are like small applications. If your embeds are not well-written, they will quickly use up the limited resources in your browser. This noticably slows things down and can even cause your browser to crash.<br \/>\nEven beautifully written embeds are very heavy. A &#8230;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[167,28],"tags":[351,95,436,112],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Optimize Your Main Page | Ning Help Center<\/title>\n<meta name=\"description\" content=\"Optimize Your Main Page | Ning Help Center\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.ning.com\/help\/optimize-your-main-page\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Optimize Your Main Page | Ning Help Center\" \/>\n<meta property=\"og:description\" content=\"Optimize Your Main Page | Ning Help Center\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ning.com\/help\/optimize-your-main-page\/\" \/>\n<meta property=\"og:site_name\" content=\"Ning Help Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Ning\" \/>\n<meta property=\"article:published_time\" content=\"2012-04-12T00:36:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-09-06T05:50:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.ning.com\/help\/wp-content\/uploads\/dimension_example1.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:creator\" content=\"@Ning\" \/>\n<meta name=\"twitter:site\" content=\"@Ning\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ning.com\/help\/#website\",\"url\":\"https:\/\/www.ning.com\/help\/\",\"name\":\"Ning Help Center\",\"description\":\"The place to look for help with the details of your Ning Network.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ning.com\/help\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.ning.com\/help\/optimize-your-main-page\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"\/help\/wp-content\/uploads\/dimension_example1.jpg\",\"contentUrl\":\"\/help\/wp-content\/uploads\/dimension_example1.jpg\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ning.com\/help\/optimize-your-main-page\/#webpage\",\"url\":\"https:\/\/www.ning.com\/help\/optimize-your-main-page\/\",\"name\":\"Optimize Your Main Page | Ning Help Center\",\"isPartOf\":{\"@id\":\"https:\/\/www.ning.com\/help\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.ning.com\/help\/optimize-your-main-page\/#primaryimage\"},\"datePublished\":\"2012-04-12T00:36:49+00:00\",\"dateModified\":\"2019-09-06T05:50:09+00:00\",\"author\":{\"@id\":\"https:\/\/www.ning.com\/help\/#\/schema\/person\/2bb31d414e68475ae47d2b01ea7f3e98\"},\"description\":\"Optimize Your Main Page | Ning Help Center\",\"breadcrumb\":{\"@id\":\"https:\/\/www.ning.com\/help\/optimize-your-main-page\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ning.com\/help\/optimize-your-main-page\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ning.com\/help\/optimize-your-main-page\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.ning.com\/help\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Optimize Your Main Page\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.ning.com\/help\/#\/schema\/person\/2bb31d414e68475ae47d2b01ea7f3e98\",\"name\":\"monica\",\"url\":\"https:\/\/www.ning.com\/help\/author\/monica\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.ning.com\/help\/wp-json\/wp\/v2\/posts\/3667"}],"collection":[{"href":"https:\/\/www.ning.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ning.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ning.com\/help\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ning.com\/help\/wp-json\/wp\/v2\/comments?post=3667"}],"version-history":[{"count":22,"href":"https:\/\/www.ning.com\/help\/wp-json\/wp\/v2\/posts\/3667\/revisions"}],"predecessor-version":[{"id":11245,"href":"https:\/\/www.ning.com\/help\/wp-json\/wp\/v2\/posts\/3667\/revisions\/11245"}],"wp:attachment":[{"href":"https:\/\/www.ning.com\/help\/wp-json\/wp\/v2\/media?parent=3667"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ning.com\/help\/wp-json\/wp\/v2\/categories?post=3667"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ning.com\/help\/wp-json\/wp\/v2\/tags?post=3667"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}