PDA

View Full Version : سوال: Content Delivery Network يا CDN چيست؟



saghari
چهارشنبه 21 اردیبهشت 1390, 12:09 عصر
با سلام و احترام
من يكي از صفحات سايتي رو با Firbug و YSlow چك كردم و در يكي از مواردي كه رنك پاييني داشت اشكال موجود در خصوص cdn بود و توضيحات داده شده اين بود.
تعداد 8 كامپوننت استاتيك كه بر روي cdn نيست وجود دارد.
دوستان اگه لطف كنن در خصوص اين CDN ، كاربردش و نحوه استفاده از اون توضيح بدن ممنون ميشم.

قبلا از توجه شما ممنونم.

saghari
چهارشنبه 21 اردیبهشت 1390, 13:14 عصر
خوب پاسخ رو اينجا (http://www.aramwebdesign.com/ViewPost.aspx?id=89) پيدا كردم

موفق باشيد

ERIKA
یک شنبه 06 مرداد 1392, 17:42 عصر
[QUOTE=saghari;1262418]خوب پاسخ رو اينجا (http://www.aramwebdesign.com/ViewPost.aspx?id=89) پيدا كردم

موفق باشيد[/QUOTE

link مشکل داره

mohsen_1687
یک شنبه 06 مرداد 1392, 18:17 عصر
ینکه اصلا وجود نداره (لینکو میگم)

ERIKA
یک شنبه 06 مرداد 1392, 19:18 عصر
Fallback for CDN hosted jQuery

Several big companies offer copies of jQuery hosted on their CDN's (Content Delivery Network). Most notoriously Google, but also Microsoft and jQuery themselves. A lot of people swear by this since it saves bandwidth, downloads faster, and perhaps even stays cached jumping between different sites that use the same script.

There is always that twinge of doubt though, that perhaps something goes wrong with these big companies CDN at the script isn't available (it happens). It's more reliable to use your own website, as hey, if

they are loading your webpage, then your server is up and will server the script just fine, albeit with out the benefits of the CDN.





<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
if (typeof jQuery == 'undefined') {
document.write(unescape("%3Cscript src='/js/jquery-1.4.2.min.js' type='text/javascript'%3E%3C/script%3E"));
}
</script>




So perhaps the best solution is to use both methods! Use the CDN first, and if it fails, load the local copy. Here is a technique: