Sharepoint托管插件性能问题 [英] Sharepoint hosted addin performance issue

查看:153
本文介绍了Sharepoint托管插件性能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


您好b $ b $
我开发了一个托管插件,它在rootsite中查询列表并显示在html中。



问题在于,第一次需要很长时间才能加载,之后它非常快。这种情况在一天中随机发生。



我已经把定时器放在代码中注意时间,我从计时器和提琴手看到的内容如下所示



MilliSeconds的时间 - 522; --- PageLoadingTime - 65005



522是我的代码执行时间,而65005是页面加载时间(包括代码执行)时间也是)。我需要几乎另外60秒来验证我​​从小提琴手那里看到的$


所以它超过2分钟,这是相当长的时间但是,一旦将应用程序加载到浏览器中,您就刷新或关闭浏览器并再次加载页面,所需时间不到2秒。这种快速加载的行为在一段时间内保持不变
如f几个小时然后又需要2分钟才能加载并且行为圈继续开来。


任何人都可以让我知道为什么会这样,我该如何解决这个问题。

我每天早上都在运行一个热身脚本,但是为什么会出现这种不寻常的应用行为,但是没有任何反应,因为这种行为会随机出现在整天出现的情况下。


所有Js文件都从本地获取,文件是jquery,bootstrap,init,MicrosoftAjax,runtime,sp.js,一个12Kb的自定义js文件

在Css中有单个css文件of 127kb



所有上述文件都只在应用程序中加载,所以我从fiddler中观察到的更多是第一次尝试请求这些文件然后他们长因为每个文件都有实际的主体内容长度所以加载的时间,甚至创建contextinfo对象花费大约
15sec但是从下次加载的文件的内容长度为16并且它们似乎没有被服务器发送

第二个障碍我看到它的ervation 3个请求所有js nad cs文件,其中2个作为401响应,0,16作为体长,而第三个来了200个具有适当的内容长度



任何人都可以告诉我如何提高此插件的性能



 

解决方案

您好,


您是否使用JSOM从Host Web获取列表项?


您可以尝试使用REST API和交叉库来实现它。并从您的页面中删除一些OOTB js库。


您可以使用自定义CSS来构建页面。


更多信息:


SharePoint 2013:如何提高首页加载速度


https://social.technet.microsoft.com/wiki/ contents / articles / 14287.sharepoint-2013-how-to-improve-speed-on-first-page-load.aspx


SharePoint中的性能注意事项加载项模型


https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/performance-considerations-sharepoint-add-in


最诚挚的问候,


Dennis


Hi

I have developed an hosted addin which queries the list in rootsite and display in the html.

The problem is that for the first time it takes a long time to load and after that it is pretty fast.This keeps on happening randomly all over the day.

I have put timer to note the time in the code and what I observe from timer and fiddler is as below

Time in MilliSeconds-- 522;---PageLoadingTime--65005

522 is my code execution time while 65005 is the page load time (this includes code execution time also).It takes almost another extra 60 second to authenticate which I see from fiddler

So over all it is more than 2 min and this is pretty long time to load.However,Once the app is loaded in browser then you refresh or close the browser and load the page again it takes less than 2 sec.This behavior of faster laoding remains same for some time like few hours then again it takes 2 minutes to load and the behavior circle continues

Can anyone let me know why is it happening and how can I fix this.
I am already running a warmup script every morning but why there is this unusual behavior of app but nothing happens with this since the behavior randomly keeps on appearing whole day

All Js files are getting laoded from local and the files are jquery,bootstrap,init,MicrosoftAjax,runtime,sp.js, one custom js file of 12Kb
In Css there is single css file of 127kb

All the above files,only, are loaded in app, so what I observed more from fiddler is that first time it tries to request these files then they long time to load since each file has actual body content length,even creating the contextinfo object takes almost 15sec but from next time the files which it loads has contentlength of 16 and it seems they are not being sent by server
Second observation which I saw it sents 3 request for all js nad cs files in which 2 of them comes as 401 response with 0,16 as body length while third one comes has 200 with proper content length

Can anyone let me know how to increase the performance of this addin

 

解决方案

Hi,

Did you use JSOM to get list items from Host Web?

You can try to use REST API and cross library to achieve it. And remove some the OOTB js libraries from your page.

And you can use the Custom CSS to build the page.

More information:

SharePoint 2013: How to improve speed on first page load

https://social.technet.microsoft.com/wiki/contents/articles/14287.sharepoint-2013-how-to-improve-speed-on-first-page-load.aspx

Performance considerations in the SharePoint Add-in model

https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/performance-considerations-sharepoint-add-in

Best Regards,

Dennis


这篇关于Sharepoint托管插件性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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