cdn

should user avatars be saved in a private directory?

拜拜、爱过 提交于 2019-12-13 04:46:57
问题 I am building a community site and i'm currently writing a script that generates thumbnails and stores them on our filesystem. Should I be storing the avatars in a private directory? or is it OK for that type of file to be in a public assets directory like a CDN? why or why not? 回答1: After searching around and looking at other sites. Google Plus in particular does not save their avatars in a private directory. In fact, their avatars are accessed from a public CDN and are served up and mixed

Is there an approach to force a Azure CDN file to download as a browser attachment?

独自空忆成欢 提交于 2019-12-12 18:08:49
问题 We're building an ASP.NET web application which integrates with a DAM (digital asset management) system. The DAM stores files in Azure blob storage and makes them available publicly using Azure CDN. We will be making these files (most are PDFs) available to download from our web app. When a user requests one of these files we will provide a custom URL which will run some code on the server (logging the download etc) before returning the relevant file for download. The client requires that the

AWS CloudFront, `Vary` header and content negotiation

放肆的年华 提交于 2019-12-12 15:22:06
问题 I'm trying to implement content negotiation based on client Accept headers so that clients that accept image/webp get webp images while clients that don't get plain old jpeg. webp and jpeg image are served from the same url, i.e. /images/foo-image/ and the content returned varies on the Accept header presented by the client. This now works great on my site. Next challenge is to get this working AWS CloudFront sitting in front of my site. I'm setting the Vary header to Vary: Accept to let

Image Fetch issues in Pinterest and Twitter from Amazon CloudFront

[亡魂溺海] 提交于 2019-12-12 14:38:14
问题 I have got a server which points to AWS ec2. - domain:-hometriangle.com And the Images are getting served from AWS CloudFront with SSL which internally points to ec2.: domain:-static.hometriangle.com Both Pinterest and Twitter are not able to fetch images. Whereas Facebook and Google are handling it well. Twitter errors:I get following logs in Card Validator > INFO: Page fetched successfully INFO: 22 metatags were found INFO: > twitter:card = gallery tag found ERROR: Internal Proxy Image

什么是CDN

若如初见. 提交于 2019-12-12 13:38:59
CDN 全称:Content Delivery Network或Content Distribute Network,即内容分发网络 是将源站内容分发至最接近用户的节点,使用户可就近取得所需内容,提高用户访问的响应速度和成功率。解决因分布、带宽、服务器性能带来的访问延迟问题,适用于站点加速、点播、直播等场景。 基本思路 尽可能避开互联网上有可能影响数据传输速度和稳定性的瓶颈和环节,使内容传输的更快、更稳定。通过在网络各处放置节点服务器所构成的在现有的互联网基础之上的一层智能虚拟网络,CDN系统能够实时地根据网络流量和各节点的连接、负载状况以及到用户的距离和响应时间等综合信息将用户的请求重新导向离用户最近的服务节点上。 目的 解决因分布、带宽、服务器性能带来的访问延迟问题,适用于站点加速、点播、直播等场景。使用户可就近取得所需内容,解决 Internet网络拥挤的状况,提高用户访问网站的响应速度和成功率。 控制时延无疑是现代信息科技的重要指标,CDN的意图就是尽可能的减少资源在转发、传输、链路抖动等情况下顺利保障信息的连贯性。 CDN就是扮演者护航者和加速者的角色,更快准狠的触发信息和触达每一个用户,带来更为极致的使用体验。 基本原理 最简单的CDN网络由一个DNS服务器和几台缓存服务器组成: 当用户点击网站页面上的内容URL,经过本地DNS系统解析

Why does the CdnFallbackExpression generate a version-less bundle?

我是研究僧i 提交于 2019-12-12 12:12:29
问题 Typically, all bundles generated by System.Web.Optimization are given versions in their query parameters. However, if you specify a CdnPath and CdnFallbackExpression value, the src attribute in the fallback <script> is left without a version. Is there a reason for this I'm not understanding, or is this a bug in the code? 来源: https://stackoverflow.com/questions/21298412/why-does-the-cdnfallbackexpression-generate-a-version-less-bundle

JQuery.Validate CDN fallback

故事扮演 提交于 2019-12-12 09:34:18
问题 A bit of a follow on from this question: Best way to use Google's hosted jQuery, but fall back to my hosted library on Google fail So I can detect if the JQuery CDN is down and allow for this: <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> <script type="text/javascript"> if (typeof jQuery == 'undefined') { document.write(unescape("%3Cscript src='/Script/jquery-1.7.2.min.js' type='text/javascript'%3E%3C/script%3E")); } </script> How do I do the same

Detect if Angular dependencies [angular-route, angular-resource, etc] are loaded for CDN fallback

北慕城南 提交于 2019-12-12 09:29:01
问题 I'm using Angular JS on ASP.NET MVC 4 and I am using script bundles to load from a cdn and also load from the origin server in case of a cdn failure like so: var jQuery = new ScriptBundle("~/bundles/scripts/jquery", "//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js") // CDN .Include("~/Scripts/jquery-{version}.js"); // Local fallback jQuery.CdnFallbackExpression = "window.jQuery"; // Test existence bundles.Add(jQuery); and var angular = new ScriptBundle("~/bundles/scripts/angular",

How to load ace editor

萝らか妹 提交于 2019-12-12 07:45:29
问题 I am trying to use the Ace code editor library (http://ace.ajax.org/), but im having trouble. According to the embedding guide, this should load the required js files from Amazons CDN. <script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script> However it fails, in Chromes console it shows: Could not load worker ace.js:1 DOMException {message: "SecurityError: DOM Exception 18", name: "SecurityError", code: 18, stack: "Error: An

Provide local fallback for CSS from CDN

可紊 提交于 2019-12-12 07:19:32
问题 I'm loading the Bootstrap CSS on my page from the CDN bootstrapcdn.com <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> How can I test if the stylesheet was loaded, and if not provide a local fallback? I do not want to wait for jQuery or other libraries to load before doing the test; I want all CSS to be loaded on the page first. 回答1: This is what I have created for our needs. If this meets your needs, simply call the function