SharePoint– Ghostable and GhostableInLibrary


What is Ghostable (only with SharePoint)

- April 20, 2015

Rest of the Story:

The Type attribute on a file defined in a SharePoint module have values of Ghostable and GhostableInLibrary

If Type is not defined they are considered UnGhostable Ok, so do you remember what this means? I tend to always forget and mix up the definitions.
What does Ghost and UnGhost mean?
When a site is provisioned SharePoint doesn’t really copy the pages for that site (i.e. default.aspx) into a new database table or directory These files exist only once on each of the front end web servers

Instead SharePoint, creates a reference to those files in the database tables that define the new site This is called “ghosting”

The end result is that each site appears to have it’s own pages but in reality they are shared across all sites that use that site definition This technique improves performance as SharePoint can retrieve this file from the file system (which is faster than performing a database operation) In addition caching a single file is more efficient than caching files for each site that exists in the farm

The process of ghosting is a huge benefit to SharePoint and performance.
Some operations, say when editing a file with SharePoint designer it causes SharePoint to unghost the file which creates a copy of the page in the database and allows users to customize particular pages for that site without effecting other sites Unghosting however does negatively effect performance and makes global changes to the entire site collection difficult.
So, in short ghosted means the file is shared across sites and each site has a pointer to a file on the file system Unghosted implies that the file has been edited and is now stored with the particular site.
What’s the difference between Ghostable and GhostableInLibrary?
The decision between Ghostable and GhostableInLibrary really is based on the type of file that you are deploying and whether you want users to view and access the document view a list or a library If you desire users to view the file within a library then you would select the InLibrary option Both Ghostable / GhostableInLibrary implies that the file will be cached in memory GhostableInLibrary however specifies that the file be cached as part of a list whose base type is Document < strong>Library and that you can work with the file as you would with any other file in the library (check-in, check-out, version history).