sharepoint - Place javascript files in 12 Hive or in Document Library? - Stack Overflow

Besides the obvious benefit of placing the custom javascript files (or any other resource files) in a d

Besides the obvious benefit of placing the custom javascript files (or any other resource files) in a document library, such as:

  • versioning, history, tracking
  • easy to change/edit

Is there any other benefits?

Performance? Page Load time?

Are there any cons?

PS. This is not meant as a question on number of files / resources has a general HTTP performance, but rather this specific SharePoint issue on the file location.

http://site/_layouts/myjavascript.js

vs.

http://site/DocumentLibrary/myjavascript.js

Besides the obvious benefit of placing the custom javascript files (or any other resource files) in a document library, such as:

  • versioning, history, tracking
  • easy to change/edit

Is there any other benefits?

Performance? Page Load time?

Are there any cons?

PS. This is not meant as a question on number of files / resources has a general HTTP performance, but rather this specific SharePoint issue on the file location.

http://site/_layouts/myjavascript.js

vs.

http://site/DocumentLibrary/myjavascript.js
Share Improve this question edited Oct 22, 2009 at 8:49 Magnus Johansson asked Oct 22, 2009 at 7:34 Magnus JohanssonMagnus Johansson 28.3k19 gold badges109 silver badges169 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 6

If you are storing the javascript in a library then it is stored in the database.

It means that:

  1. It has version control

  2. It is slower then the filesystem (unless you are using blob cache)

  3. It will be included in any backups you do of your sharepoint install (stsadm for example)

  4. It will be accessible (changeable) by anyone with access to the document library (easier to maintain, less secure)

  5. Client side caching will behave differently (you'll need to configure it, it's a bit plicated for MOSS content vs filesystem content)

We decided to store it in the 12 hive as it feels better in regards to code vs. data separation. If you consider this file to be data then store it in MOSS, if you consider it to be "code" then store it in the filesystem.

have you considered using google to host javascript files (such as jquery)

  • this benefits from using their bandwidth for downloading the files
  • faster page loading times
  • higher availability
  • chances are high that your javascript file is already cached on the user's machine

Document Library

Pros - Automatic delivery to all web front ends, easy, versioning, history, ease of editing

Cons - Slower (it's in the database),Security issues brought about by accidentally securing the item's site, login prompts if you are referencing the js via absolute URL your users may get repeated login prompts

Plasing the js file in the 12 hive

Pros- faster, no issues with the aformentioned security prompts

Cons - Not automagically delivered to all of your web front ends, possible AAM issues, technically you are not supposed to modify files in the 12 hive

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745172816a4615029.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信