cdn

Why randomize your file names for cloud storage/CDN?

我们两清 提交于 2019-12-03 08:35:34
When you look at a profile picture on a social networking site like Twitter, they store image files like: http://a1.twimg.com/profile_images/1082228637/a-smile_twitter_100.jpg or even with a date somewhere in the path like 20110912. The only immediate benefit I can think of is preventing a bot from going through and downloading all files in your storage in a linear fashion. Am I missing any other benefits? What is the best way to go about randomizing it? I am using Amazon S3 so I will have one subdomain serving all my static content. My plan was to store an integer ID in my database and then

jQuery via Google CDN best practices

戏子无情 提交于 2019-12-03 07:55:51
I'm loading jQuery via Google's CDN using the following code. My main question is what will happen if a user hits my site and hasn't yet got jQuery pre-cached. Will he download the Google version and my own? How does concurrency here work? <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> if(typeof jQuery == 'undefined') { //<![CDATA[ document.write("<script src='/includes/jquery-1.4.2.min.js' type='text/javascript'><\/script>"); //]]> } </script> Thanks. In your example code they will download the

Put images on CDN, using MVC3 on IIS7

ε祈祈猫儿з 提交于 2019-12-03 07:44:12
问题 I need to use CDN for all images on my site. So, Ive decided to use IIS Url-rewriting module, because edit manually all my site views - its impossible for me. So Ive made rules for IIS, eg: <rule name="cdn1" stopProcessing="true"> <match url="^Content/Images.*/(.*\.(png|jpeg|jpg|gif))$" /> <action type="Redirect" url="http://c200001.r9.cf1.rackcdn.com/{ToLower:{R:1}}" redirectType="Permanent" /> </rule> Its worked, but as you can see there is redirect type is used (301 Permanent). And I think

Twitter Bootstrap Alpha 4.0 - 404/403 Response from CDNs in MS Edge

主宰稳场 提交于 2019-12-03 07:26:52
So I was wondering why I was getting the following responses back (404/403) when using Twitter Bootstrap Alpha 4.0 from either MaxCDN or CDNjs in the Microsoft Edge browser. Other notes: - This only happens in MS Edge, all other modern browsers don't return this - This only seems to happen with the CSS files, not the Bootstrap JS - This happens both locally and when published I am simply loading it in the <head> as usual: <link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> UPDATE: There is also a post discussing

Hosting Javascript/CSS file on CDN similar to Google hosting jQuery

走远了吗. 提交于 2019-12-03 07:12:26
问题 I am wondering if there are any hosts or if I can host my file (JS & CSS) on Google so that they are cached and load real quick (due to CDN and gzip). A number of my customers use these files and I would prefer if they could somehow include this to file to receive the JS file. Ideally with filename.js?publickey=sdfgsdfg (which will be tied to a particular domain name). The problem is that my hosting needs are very small- only about 100kb. Any suggestions? My problem is that the customers

cdn是否可以抵御ddos的攻击

佐手、 提交于 2019-12-03 06:51:07
随着近年来来网络技术的不断进步,cdn不仅可以简单的用做网站加速,还能够更好的保护网站不被攻击。cdn在相关节点中成功的建立动态加速机制以及智能沉于等机制,能够帮助网站流量访问分配到每一个节点中,智能的进行流量分配。如果cdn存在被ddos攻击的情况,Cdn整个系统就能够将被攻击的流量分散开,节省站点服务器的压力以及节点压力。同时还能够增强网站被黑客攻击的难度,真正帮助服务管理人员提供更多的时间。 但是 cdn防ddos 攻击主要是通过流量分散,增加攻击难度,如果是有针对性的大规模攻击,就会面临被各个击破的危险。从另一种层面上来说,cdn只是缓解了DDoS攻击的时效而已,若想有效阻止攻击,还可以采用ddos防火墙等安全防御方法。另外,专门抵御DDoS的方法还有下面这几个。 异常流量的清洗过滤:通过 DDOS防火墙 对异常流量进行清洗过滤。通过数据包的规则过滤、数据流指纹检测过滤、及数据包内容定制过滤等技术可以准确判断外来访问流量是否正常,进一步将异常流量禁止过滤。单台负载每秒可防御800-927万个syn攻击包。 分布式集群防御:这是目前网络安全界防御大规模DDOS攻击的最有效办法。分布式集群防御的特点是在每个节点服务器配置多个IP地址,并且每个节点能承受不低于10G的 DDOS 攻击,如一个节点受攻击无法提供服务,系统将会根据优先级设置自动切换另一个节点

How do I load third party JavaScript from a CDN when using RequireJS?

放肆的年华 提交于 2019-12-03 05:40:57
问题 I've been using RequireJS for dependency management and must say that I love it - JavaScript has really matured recently. However, one thing I cannot figure out is this: When using the optimizer to bundle all my JavaScript modules into one file, how can I keep loading some thirt party scripts (such as jquery) from an external CDN URL instead of having to bundle it with my application code? 回答1: This will load jQuery from a CDN: <script src="http://requirejs.org/docs/release/2.1.5/comments

Using React Router with CDN and without webpack or browserify

谁说我不能喝 提交于 2019-12-03 05:23:01
Resume : I need to run React Router without wepback or similar tools. Directly from CDN links, but I'm stuck with some require.js error. I'm starting to build my first App with React and I'm struggling with React Router. HTML: <body> <div id="container"></div> <script src="https://unpkg.com/react@15/dist/react.js"></script> <script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.js"></script> <script src="https://npmcdn.com/react-router@2.4.0/umd/ReactRouter.js"></script> <script type="text/babel"

How secure are CDNs for delivering jQuery?

瘦欲@ 提交于 2019-12-03 04:44:15
We build sites that have a public (non-secured) area and secured (delivered over HTTPS) area and we use jQuery library. Recently I suggested we use Google CDN for jQuery delivery. Some of my colleagues expressed concerns in regards to security aspect of this way of delivering JavaScript libraries. For example, they mention the scenario where someone might hijack DNS server and then inject maliciously modified library, opening the door for different security attacks. Now, if hacker can inject malicious code through Google CDN, then he can probably do the same if jQuery is served from the site

Prepend CDN url to mvc 4 bundler output

五迷三道 提交于 2019-12-03 04:35:21
问题 Using the built in MVC4 bundler, how do I prepend my CDN url to the link tags it produces? I've setup Amazon Cloudfront so that it pulls assets from my webserver when first requested. So when I define a bundle like so: bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/reset.css", "~/Content/960_24_col.css", "~/Content/Site.css" )); When deployed, I can reference it thus: http://[cloundfrontid].cloudfront.net/Content/css?v=muhFMZ4thy_XV3dMI2kPt-8Rljm5PNW0tHeDkvenT0g1 Now I just