Le attività del sito vs. libreria di stili
-
16-10-2019 - |
Domanda
I solito memorizzare i miei file JavaScript / jQuery nella biblioteca risorse del sito, ma vedo sul forum che altri stanno utilizzando la libreria di stili.
Quali sono i rispettivi vantaggi di ciascuno?
Soluzione
Resources in Style Library will most likely send the correct caching headers.
There were issues in 2007, here is a good rundown.
http://www.sharepointnutsandbolts.com/2009/05/optimization-blob-caching-and-http-304s.html
Altri suggerimenti
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" :-)
Style Library is the default for pub portal template sites (i.e. internet facing sites).