问题
Provide some useful tips as
- How can I improve the speed of my website?
- What are the advantages & disadvantages of using sub domains?
My website is CareerMitra.com
回答1:
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...
回答2:
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.
- Are these CSS & JS files always required? If yes, can I combine them into one?
- 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.
回答3:
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.
- 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.
回答4:
Best practices
- Minimum HTTP request
- Minified CSS and JS code
- Sprite images
- Proper Cache control
来源:https://stackoverflow.com/questions/11777192/web-tips-for-improving-speed-of-my-website