问题描述
我使用mailchimp让用户在我的网站上签名通讯。我刚刚意识到mailchimp需要140kb,几乎占我的目标网页加载量的10%。
I use mailchimp to let users sign for a newsletter on my website. I just realized that mailchimp needs 140kb for that which is almost 10% of my landing page loadings.
<!-- Begin MailChimp Signup Form -->
<div class=" col-sm-8 col-sm-offset-2 col-xs-12 onewayDistance" ng-class="{'col-md-8 col-md-offset-2': !newsletterModal,'col-md_8':newsletterModal}" >
<!--link href="//cdn-images.mailchimp.com/embedcode/classic-081711.css" rel="stylesheet" type="text/css"-->
<div id="mc_embed_signup" >
<form action="//tripdelta.us8.list-manage.com/subscribe/post?u=9a2a27b15c44950e3ba360a28&id=9b656d6732" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div class="row">
<div class="col-xs-12 " id="stayInformed">
{{'STAY_INFORMED'|translate}} <span>{{'NEWSLETTER'|translate}}</span>
</div>
<div class="col-xs-9 col-md-4 col-md-offset-3 mc-field-group ">
<input type="email" ng-model="userEmail" placeholder="{{'ENTER_EMAIL'|translate}}" name="EMAIL" class="required email" id="mce-EMAIL">
<div id="mce-responses" class="clear" style="background-color: rgba(255,255,255,0.6)">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;">
<input type="text" name="b_9a2a27b15c44950e3ba360a28_9b656d6732" tabindex="-1" value="">
</div>
</div>
<div class="col-xs-3 col-md-2" id="newsletterButton">
<button type="submit" name="subscribe" id="mc-embedded-subscribe" ng-class="{'newsletterModalColor':newsletterModal}" class="button">{{'SUBSCRIBE'|translate}}</button>
</div>
</div>
</form>
</div>
<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'>
</script>
<script type='text/javascript'>
(function($) {
window.fnames = new Array();
window.ftypes = new Array();
fnames[0]='EMAIL';
ftypes[0]='email';
}(jQuery));
var $mcj = jQuery;
</script>
</div>
这只是普通代码,我只是从他们的网站上复制并做了一些css更改。是否有机会最小化要加载的数据量?
This is just normal code which i simply copied from their website and did some css changes. Any chance to minimize this amount of data to be loaded?
推荐答案
似乎从这里下载了JQuery API:
It seems there's JQuery API being downloaded from here:
// s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js
//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js
所以,如果你的网站已经使用过JQuery,那么你可以不用这个。
但似乎他们已经对它进行了修改(我不确切知道修改了什么,但看起来你看起来似乎都是代码)。
So, if your website already use JQuery maybe you don't have to put this one.But it seems they've modified it (i don't know exactly what is modified but it seems if you look trough all the code).
I现在不能想到另一种缩小尺寸的方法:/
I can't think an other way to reduce the size right now :/
这篇关于Mailchimp需要140kb才能加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!