Web tips for improving speed of my website?

前端 未结 4 1768
情书的邮戳
情书的邮戳 2020-12-20 09:05

Provide some useful tips as

  • How can I improve the speed of my website?
  • What are the advantages & disadvantages of using sub domains?
相关标签:
4条回答
  • 2020-12-20 09:58

    Best practices

    1. Minimum HTTP request
    2. Minified CSS and JS code
    3. Sprite images
    4. Proper Cache control
    0 讨论(0)
  • 2020-12-20 10:00

    The ultra basic tips to improve the speed would be .

    1.use semantic mark up

    2.use less images- try Raphael JS, HTML5 Canvas and other native drawing approaches

    3.minify your javaScript

    4.minify your css

    5.use gzip

    6.remove APIs that you dont use, include only whats needed.

    7.use localStorage and Cache Manifest where ever possible

    8.use css3 effects such as gradients,box-shadows,text-shadows ect.. instead of images and background-images

    9.have a clean and simple design

    10.hand code to keep your code simple and minimal.

    1. use script tags at the bottom

    one very important thing .. develop your site keeping users in mind not SEO or ad revenue. keep it simple.

    0 讨论(0)
  • 2020-12-20 10:03

    use pageSpeed(google) and Yslow(Yahoo) browser's extensions (with firebug or not) for view ALL good pratices for improve your website faster.

    For sample : this is a list of good practises checked by Yslow in your Website :

    • Minimize HTTP Requests
    • Use a Content Delivery Network
    • Avoid empty src or href
    • Add an Expires or a Cache-Control Header
    • Gzip Components
    • Put StyleSheets at the Top
    • Put Scripts at the Bottom
    • Avoid CSS Expressions
    • Make JavaScript and CSS External
    • Reduce DNS Lookups
    • Minify JavaScript and CSS
    • Avoid Redirects
    • Remove Duplicate Scripts
    • Configure ETags
    • Make AJAX Cacheable
    • Use GET for AJAX Requests
    • Reduce the Number of DOM Elements
    • No 404s
    • Reduce Cookie Size
    • Use Cookie-Free Domains for Components
    • Avoid Filters
    • Do Not Scale Images in HTML
    • Make favicon.ico Small and Cacheable

    Also, there not advantages or disavantages to use subdomain for speed... But, this can be an advantage or disavantage for SEO, but it is not your question...

    0 讨论(0)
  • 2020-12-20 10:04

    Major optimization can be achieved by reducing the number of server requests. Any other optimizations will not result in big difference in performance generally. With that in mind, lets inspect your website.

    An initial page load required about 36 requests. Out of this, 4 requests were for CSS and about equal number of JS files. Now If I was you, I would ask myself the following questions.

    1. Are these CSS & JS files always required? If yes, can I combine them into one?
    2. Can I avoid loading the unrequired CSS & JS files for initial page load? i.e. download them only when necessary and being used. (E.g. is print.css required for initial page load ?)

    The rest of requests are majorly for images. So you should consider using 'sprites' to reduce the number of server requests. Read about them and learn to use it from here http://css-tricks.com/css-sprites/. Again be smart in combining the images. Ask the same questions as above while deciding to combine images.

    With these two steps, you should be able to reduce the number times you go to server and comeback.

    Next optimization would be to reduce the size of each request. For this, consider minifying your CSS and JS files. Also compress the images without loosing quality. Have appropriate sized images i.e. if you have an image of dimensions say '778 x 475' but the image is displayed in smaller dimension of 475 x 250, then you should think of resizing the image to reduce its size.

    Also be smart in identifying your audience. If you're audience are tech-savy and use modern browsers then you can reduce HTML, JS code size and some unnecessary request for images as you can achieve the same using CSS3 and HTML5.

    0 讨论(0)
提交回复
热议问题