如何减少使用Javascript / jQuery的/ AJAX加载时间为我的网站? [英] How to reduce javascript / jquery / ajax load time for my website?

查看:172
本文介绍了如何减少使用Javascript / jQuery的/ AJAX加载时间为我的网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何减少使用Javascript / jQuery的/ AJAX加载时间为我的网站?  我的网站是: http://maavankal.com/

How to reduce javascript / jquery / ajax load time for my website ? my website is : http://maavankal.com/

推荐答案

速度性能由<一个href="https://developers.google.com/speed/pagespeed/insights#url=http_3A_2F_2Fmaavankal.com_2F&mobile=false&rule=MinifyJavaScript"相对=nofollow>谷歌PageSpeed​​ 提出以下建议对JavaScript:

Speed performance by Google PageSpeed suggests the following for JavaScript:

Minifying the following JavaScript resources could reduce their size by 33KiB (29% reduction).
Minifying http://maavankal.com/source/jquery.fancybox.js?v=2.1.3 could save 16.6KiB (36% reduction).
Minifying http://maavankal.com/js/jquery.simplyscroll.js could save 3.4KiB (29% reduction).
Minifying http://maavankal.com/js/jcarousellite.js could save 2.7KiB (52% reduction).
Minifying http://maavankal.com/js/content_switch.js could save 1.9KiB (30% reduction).
Minifying http://maavankal.com/js/bgStretch.js could save 1.6KiB (37% reduction).
Minifying http://maavankal.com/js/cScroll.js could save 1.6KiB (33% reduction).
Minifying http://maavankal.com/js/forms.js could save 1.4KiB (26% reduction).
Minifying http://maavankal.com/js/jquery-ui.js could save 1KiB (5% reduction).
Minifying http://maavankal.com/.../jquery.fancybox-buttons.js?... could save 1KiB (35% reduction).
Minifying http://maavankal.com/js/superfish.js could save 946B (26% reduction).
Minifying http://maavankal.com/js/script.js could save 883B (18% reduction).

其他建议:

  • 尝试避免使用多发$(文件)。就绪语句
  • 使用jQuery的1.9.x的最新版本
  • 您使用了大量的插件。你可以将你的插件/脚本到1文件,你可以做到这一点很容易使用谷歌关闭编译器
  • 将你的内联标签到身体的末端(包括一些花哨的盒子),这些可能增加的DOM
  • 的加载时间
  • Utilise DOM缓存在你的jQuery code
  • 检查缺少的媒体(如图像)可以停止你的网页的加载。是/images/bg.jpg不见了?
  • 使用网络面板镀铬开发工具来分析你的网页的媒体的加载时间
  • Try avoid using mutiple $(document).ready statements
  • Use the latest version of jQuery 1.9.x
  • Your using a lot of plugins. You could combine your plugins/scripts into 1 file you can do this very easily using Google Closure compiler.
  • Move your inline tags to the end of the body (some including fancy box) these may increase the loading time of the dom
  • Utilise DOM caching in your jQuery code
  • check for missing media (such as images) may halt the loading of your page. is /images/bg.jpg missing?
  • Use the network panel in chrome dev tools to analyse loading times of your page media

这篇关于如何减少使用Javascript / jQuery的/ AJAX加载时间为我的网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆