I have a debate with a colleague of mine that deals with where to place images that must be accessible across the farm. I feel that for images that need to be accessed from anywhere, I should place them in the hive. The other opinion is that the images should be placed in a list somewhere within the farm. What are the drawbacks or benefits for either place?
|
|
The key word in your question is "farm", and this answers your question for you: HIVE. THE HIVEThe SharePoint hive was designed to house a single instance of those files which are used across all the sites and web apps within a SharePoint farm (regardless of the site type or branding etc).
THE STYLE LIBRARYPlacing files in the Style Library (which is created when the Publishing Infratsructure feature has been enabled) offers one advantage over the hive: version control. As with all files that are stored in lists, you get a full update history and rollback functionality. The main disadvantage of storing your CSS and images in this list though is scope. Files that are uploaded to lists can not be shared outside of that particular site collection. And for an application like an intranet which would most likely contain many site collections, you'd need to use a feature to provison copies of all your images, CSS and masterpages to every site collection in order to maintain a consistent look & feel. And in the case of the example above, you'd need to replicate this across all site collections in all your web apps! As with anything in SharePoint it's always good to follow Microsoft's lead. They use the hive as the root location for all their branding files (which define the default theme that is applied to any new site) and then they deploy any additional site-specific branding files to the Style Library list within those sites. |
||||
|
|
The final answer to this is that both will provide images which can be used for branding. There are reasons for both, however I believe the better way (especially when using publishing) is to use the Style Library in a site to insert branding images. Images are then stored in the content DB, and when a content DB is restored (e.g. DR scenario), the images will still be available to the farm for branding. There is a performance hit for BLOBs in SQL, that's true: but if this were the reason you wouldn't add images, I would suggest not using SharePoint as document/image libraries are what SharePoint is designed to manage (yes there is RBS for storing documents on a file system if required). Adding images to the 12-Hive (dpeloyed say via a feature in a WSP package) could work as well, and provide greater reach (farm scoped) for branding. You could have a master Branding library and have styles linking to them (using absolute paths). In summary, most images I would put in a library inside of SharePoint. This helps ensure your branding will follow your site(s) where-ever they go, and makes managing them much easier. They can still be available throughout the whole farm anyway. |
|||||||||
|
|
I lean towards the hive for two reasons: one is as you mentioned, it's globally available and I find easier to manage. The other is anything in a list or library is blob-ified into SQL, therefore to call your images for your branding, SharePoint calls SQL to get the files (of course you should use blob caching here to help with the performance). The biggest benefit of keeping the images in a library in SharePoint is that they're easily updatable, you can modify your images and such just by uploading a new image. |
||||
|
|