I usually store my JavaScript/jQuery files in the Site Assets library, but I see on forums that others are using the Style Library.

What are the respective benefits of each?

3 Answers 3


Resources in Style Library will most likely send the correct caching headers.

There were issues in 2007, here is a good rundown.


  • Wouldn't the issues also exist in 2010, in 2007 there was no Site Assets library - and really the Style library and the Site Assets libraries are just that - libraries.
    – James Love
    Commented Apr 27, 2011 at 9:37

Another option is to deploy this to your _LAYOUTS folder.

As djeeg point out, Style Library has issues (304's due to incorrect max-age). I am not sure this is fixed (it would surprise me!).

Another plus for storing in a virtual directory is that you can use them across web applications, since they reside in the SharePoint root folder. This ofcourse can also be a weakness if you need permissions or versioning, so as usually when we are talking SharePoint, the answer is "it depends" :-)

  • 1
    My question is specifically about Site Assets vs. Style Library. In my case (hosted), the _layouts folder is not accessible. I thought djeeg was recommending the Style Library: "... will most likely send the CORRECT caching headers".
    – Christophe
    Commented Apr 27, 2011 at 8:35
  • 3
    Ok, I have added SharePoint-Online tag to your post to clarify this! I would not bet money that the max-age problem is solved in SP2010, but given there is no alternatives thats just the way it is :-) As for recommendations, an asset library is ment for videos, pictures and sound for contributors, where Style Library is ment for CSS, JS, XSLT and images used for the layout of the site (icons etc) that the contributors will not need access to (other than Limited Read access). Remember to create your own subfolders... Commented Apr 27, 2011 at 11:18
  • Also the Style Library uses check in/check out and approval whereas the asset library does not (if that's a pro/con in your situation). Commented Apr 27, 2011 at 12:20

Style Library is the default for pub portal template sites (i.e. internet facing sites).

  • 1
    -1 The OP is asking what the respective benefits are of each.
    – Alex Angas
    Commented May 31, 2011 at 22:58
  • Well one benefit would be following Microsoft guidelines. Style Lib is the way to go. I don't think my answer warrants a negative point.
    – SPS Guy
    Commented May 4, 2012 at 22:29
  • Please could you edit your answer to expand on why you recommend the Style Library and a link to the MS guidelines? Then with any luck you will stop getting downvotes and multiple flags. See answer for general guidelines.
    – SPDoctor
    Commented May 7, 2012 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.