cdn

Is it bad to hotlink jQuery from jquery.com?

你说的曾经没有我的故事 提交于 2019-12-07 04:31:57
问题 This will probably get a pretty nasty response, but my server isn't the fastest at the moment, and my site loads much faster if I hotlink from the jQuery homepage so they server the content. Is this bad to do? Does jQuery eventually remove those js files from their page? 回答1: Better hotlink it from Google API libraries. Very big advantages: Google is fast and highly available Separate hosts, allows the client to load JQuery simultaneously with your pages and images (browsers support only a

CDN for blueprint css framework [closed]

好久不见. 提交于 2019-12-06 17:14:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Does anyone know a free CDN for blueprint css framework 回答1: Well, it's not technically a CDN but you can link directly to github <link rel="stylesheet" href="//github.com/joshuaclayton/blueprint-css/raw/master/blueprint/print.css"/> <link rel="stylesheet" href="//github.com/joshuaclayton/blueprint-css/raw

Configuring RequireJS to load from multiple CDNs

寵の児 提交于 2019-12-06 14:14:40
I'm using RequireJS on our site and before the files are deployed to production we are using rjs to minify the files. Currently I am creating several minified files, not a single file. For better load times on our site we are also using multiple CDNs so the browser will open more download streams and the static content will load as fast as possible. Here lies my problem. I can configure RequireJS through the baseUrl parameter to load my scripts from our CDN, but is there a way to configure RequireJS to use a random baseUrl? I know by default this isn't possible, but I was hoping maybe someone

How to use CDN Imports in a React-Project

一曲冷凌霜 提交于 2019-12-06 13:47:11
问题 My project is based on create-react-app and now I want to use Here Maps. Their documentation recommends loading the modules with CDN and I cant find any NPM packages for it. My question now is: how can I load the CDN properly? I know there is the possibility to just put the CDN link inside my index.html file but this seems not to be the right solution I think. 回答1: You can programmatically add JS script tags. Here's an example function loadScript( {src, id, callback} ) { if(id && document

Why Heroku don't use the good manifest.yml

ε祈祈猫儿з 提交于 2019-12-06 13:43:19
问题 I use Rails 3.2.2 on Heroku with CDN (CloudFront) to host assets. I try the Heroku tutorial (https://devcenter.heroku.com/articles/cdn-asset-host-rails31) with asset_sync gem. There is no problem with the assets:precompile, all my assets are hosted on my S3 bucket. -->heroku run bundle exec rake assets:precompile Running bundle exec rake assets:precompile attached to terminal... up, run.1 AssetSync: using default configuration from built-in initializer AssetSync: Syncing. Using: Manifest /app

Cloudfront and CSS/JS assets

99封情书 提交于 2019-12-06 13:32:24
I have a cloudfront distribution set up to go to myapp.herokuapp.com Maybe I've misunderstood Cloudfront and CDNs in general, but I thought that somehow the CDN hosted the static files instead of me just including references to the CDN URL in my HTML files stored on Heroku. What I'm seeing in my Chrome Network tab is: Request URL: http://blah123.cloudfront.net/css/style-123.css Request Method:GET Status Code:301 Moved Permanently then: Request URL: http://myapp.herokuapp.com/css/style-123.css Request Method:GET Status Code:304 Not Modified Is there another way to set up Cloudfront so that the

Fontawesome Cross origin issues

China☆狼群 提交于 2019-12-06 12:02:03
I want to load Fontawesome from a CDN but I get failed cross-origin request. Resource access is restricted I know that to fix this a HTTP header should be added, but is there any way to avoid doing this? I tried replacing '../font/fontawesome-webfont.eot?v=3.2.0') with full urls but it didnt help for some reason. Is there anything that can be done without the header? Nish This is browsers’ same-origin policy restrictions http://www.w3.org/TR/css3-fonts/#same-origin-restriction . If you are using amazon s3 this could help you Amazon S3 CORS (Cross-Origin Resource Sharing) and Firefox cross

Hosting static HTML in a Play! app on CloudFront

狂风中的少年 提交于 2019-12-06 10:51:45
I have a (high-traffic) chunk of my website that is entirely static. All the site's URLs are relative, so right now it all works if I just point my browser to http://gj232j2j213.cloudfront.net/blah . I'd like to host the entire thing (not just images and css, but the HTML too) on Cloudfont (or some other CDN). Ideally, I could put something like: GET /static/ staticDir:http://gj232j2j213.cloudfront.net/blah in my routes file. That way my URLs would look like www.mydomain.com/static/main.html , and I wouldn't have to bounce the user to a different subdomain as they moved back and forth between

阿里云CDN接入踩坑记录

北慕城南 提交于 2019-12-06 08:55:12
最近负责的系统安全要求接入CDN,避免DDOS之类攻击,然后华丽丽踩了两个大坑。回顾问题原因后,发现还是相关人员都对CDN原理不够熟悉、了解导致。 坑一:默认支持的文件上传最大是300M 问题现象: 接入CDN后,连续两个用户反馈视频上传失败。系统对视频最大长度有限制,一开始引导用户确认时长,后来给力的用户居然定位到精超过300M就上传失败。 问题原因: 1.除了接入CDN,系统未进行任何变更,因此很快定位到是接入CDN导致。 2.跟阿里云咨询,确认如下: 默认支持的最大文件为300M;可以申请放开限制,但最大只支持2G 。因此,涉及4K、高清视频上传的业务要注意。 3.一般上传类业务比较少接入CDN。 坑二:链路经过两层阿里云CDN,会出现508响应 问题现象: 系统有一个功能是文件直接上传到阿里云,会返回一个CDN的地址。直接访问返回的CDN地址,国内可以正常访问;国外无法访问,http响应code为508,loop detected(服务器在处理请求时陷入死循环). 问题原因: 1.该功能是一直存在的,此次新增的接入CDN的域名包含该CDN回源的地址,因此会经过两层阿里云CDN( 链路:CDN域名(CDN1)-->新接入CDN的域名(CDN2)-->服务 ),就出现问题。 2.这种应该是CDN厂商都会进行处理的,避免在CDN节点之间无限循环,回源的时候就应该直接到源站

Google Maps API 3 referrerNotAllowedMapError

a 夏天 提交于 2019-12-06 04:41:49
问题 I'm no stranger to Google Maps APi, and have used it for years...but I am stumped. I've installed an exact copy of the latest code sample from Google Maps Javascript API: Simple Map. I then confirmed both my browser and server keys from Google Developers Console, added the refer two different ways(see below). Code works when I set the referer to * wildcard in console, but cannot use that in production. Here's the skinny: tested using latest example code from Google Maps API Javascript (Simple