- Including height and width in <img /> tags will allow your page to render more quickly, because space can be allocated for the image before it is downloaded.
- Add script references at the bottom of the page before </body>, because asynchronous downloads halt when a script reference is reached. Style sheets and images can be downloaded asynchronously in <head>.
- Use a content delivery network (CDN) for hosting images and scripts. They may be cached and it will reduce load on your server.
- Use image sprites to retrieve smaller images in one download.
- Use AJAX to retrieve components asynchronously that may not be needed immediately, such as the content of a collapsed panel, content behind a tab, and so on.
- Make sure you've removed HTTP modules that aren't being used (Windows authentication, for example), and that you've disabled services such as FTP and SMTP, if you're not using them.
- Make sure HTTP compression is turned on for any uncompressed content. HTML in particular compresses significantly, and in this era of mobile friendliness and slow 3G connections, that’s essential.
- Always set the CacheControlMaxAge attribute in web.config to a high number (a year is good). You don't want people pulling down the same static content they did last week. It'll also save on the bandwidth you’re paying for.
- Make use of the OutputCache annotation on MVC controllers. If the server can serve from memory, rather than going to disk or database, that's a good win.
Monday, 19 January 2015
ASP.NET Tips #17 - General and HTML tips
Labels:
ASP.NET
,
Optimization
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment