Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Tuesday, January 27, 2009

Best Practices for Speeding Up Your Web Site

Очень полезные советы собранные все вместе

http://developer.yahoo.com/performance/rules.html


Make Fewer HTTP Requests
Use a Content Delivery Network
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
Flush the Buffer Early
Use GET for AJAX Requests
Post-load Components
Preload Components
Reduce the Number of DOM Elements
Split Components Across Domains
Minimize the Number of iframes
No 404s
Reduce Cookie Size
Use Cookie-free Domains for Components
Minimize DOM Access
Develop Smart Event Handlers
Choose link over @import
Avoid Filters
Optimize Images
Optimize CSS Sprites
Don't Scale Images in HTML
Make favicon.ico Small and Cacheable
Keep Components under 25K
Pack Components into a Multipart Document

Monday, December 1, 2008

Вынос jQuery в одно место

From: Stanislau Sliunkou 
Sent: Monday, December 01, 2008 12:48 PM
To: Aliaksandr Sarakaletau; Alexey Strakh
Cc: Yauheni Damanau
Subject: RE: single jquery location


Я за сборку. 

Одна из проблем, которые она решает – это переключение packed/debug версий. 
Вторая – не надо в каждом новом веб-сайте добавлять одни и те же скрипты. Т.е. у нас будет одно место для хранения всех скриптов (я давно хотел). 
Третья – мы можем контролировать повторное подключение скриптов, если у нас на master page подключается, а потом в каком-нить контроле.

Для удобства предлагаю еще написать небольшую обертку или дописать наш JScriptHelper для удобного подключения jQuery и плагинов к нему.

From: Stanislau Sliunkou 
Sent: Monday, December 01, 2008 10:33 AM
To: Alexey Strakh
Cc: Aliaksandr Sarakaletau; Yauheni Damanau
Subject: RE: single jquery location


http://www.west-wind.com/Weblog/posts/413878.aspx

Вот опять актуальная статья. Обсуждаются различные варианты подключения js файлов. В том числе есть способ через сборку. Сча еще раз перечитаю и скажу «What do I think» )

From: Alexey Strakh 
Sent: Friday, November 28, 2008 7:10 PM
To: Stanislau Sliunkou; Aliaksandr Sarakaletau; Yauheni Damanau
Subject: single jquery location


А что если если включить ввиде ресурсов в aspcommon.dll (как альтернатива с single web location)?
Benefits:
1. Single location
2. no problem with versioning. 
3. Asp.net handler to retrieve it already exists

What do you think?


Thanks,
Alexey Strakh

Inclusion of JavaScript Files

•Include in a scripts folder and link via script include as jQuery.js 
•Include in a scripts folder and link via script include as jQuery-1.2.6.js (ie. version specific) 
•Link to the version specific file at jQuery.com (typically jQuery-1.2.6.js) 
•Link to the latest version at jQuery.com (ie. jQuery-latest.js) 
•Link to some other script hosting site (ie. Google's Ajax Lib API) via script loading 
•Embed scripts into ASP.NET Resources 
•Use ScriptManager to load scripts either from Folder or Resources 
•Use a custom script manager 

http://www.west-wind.com/Weblog/posts/413878.aspx