Ads

Sunday, 15 November 2015

CACHING IN SHARE POINT 2010 & BEST PRACTICE

Use: Improve the speed at which Web pages load in the browser.

Types: a. The BLOB cache.
            b. The Page Output Cache. (Need to activate SharePoint Server Publishing)
            c. The Object Cache (Need to activate SharePoint Server Publishing)
BLOB cache: (Off by default)
A disk-based cache that stores files used by Web pages to load quickly and reduces the load on database server when it uses those files.
Stored directly on the hard disk drive of a front-end Web server computer.
By enabling it from Web.config of web application it will apply for all site coll of that web appl.
Configuration:
Start -> Administrative Tools -> Internet Information Services (IIS) Manager -> Navigate to sites
R-click web application site -> Explore -> Web.config -> Now find the following lines
<BlobCache location="C:\BlobCache\14" path="\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|themedbmp|themedcss|themedgif|themedjpg|themedpng|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv|ogg|ogv|oga|webm|xap)$" maxSize="10" enabled="false" />
Change the location attribute to specify a directory that has enough space to accommodate the cache size.
Change the enable to true,also can modify the file types to be cached &  maxSize  -> Save the config.

Page Output cache: (ASP.net Output Cache)
An in-memory cache that saves rendered ASPX pages.
it reduces SQL calls & workload on the WFE because pages do not need to be re-rendered.
if the pages are anonymous, then no SQL check needs to be done at all present the cached pages.
Configuration:
For catch profile setting can configure at site coll level and also from web application level
<OutputCacheProfiles useCacheProfileOverrides="false" varyByHeader="" varyByParam="*"  varyByCustom="" varyByRights="true" cacheForEditRights="false" />

Object cache: (On by default)
Stores metadata about SharePoint Server objects (like SPWeb, SPSite, SPList, etc.) on the WFEs.
If any data needs to be retrieved through these objects, the SQL Server will not be hit.
Content query WP, navigation, search query box and metadata navigation uses this feature.
Can be configured at the site collection level in UI by a site collection administrator,
Maximum cache size used by all site collections can configure from web application level
Configuration:
Open web.config of web application -> set size: <ObjectCache maxSize="100" /> -> save it




Saturday, 14 November 2015

Extend a Web application (SharePoint Server 2010)

Use:
If you want to expose the same content in a Web application to different types of users by using additional URLs or authentication methods, you can extend an existing Web application into a new zone.
It create a separate Internet Information Services (IIS) Web site for same content with diff authentication process.
Ext web app has five network zones (Default, Intranet, Internet, Custom, and Extranet).

Reference : One, Steps involved
Plan for authentication methods
Extend for web app having classic-Authentication

Friday, 13 November 2015

Difference between assemblies present in bin folder vs GAC


  • <Assembly DeploymentTarget="GlobalAssemblyCache" Location="MyCompiledClass.dll">   ->  added MyCompiledClass as assembly to GAC
  • <Assembly DeploymentTarget=" WebApplication" Location="MyCompiledClass.dll">   ->  added MyCompiledClass.dll to bin directory

GAC:
Runs with full trust
Key point is dlls in the GAC (Global Assembly Cache) have full privileges. dll's in the bin have restricted privileges.
Certain tasks such as timer jobs, workflows, service applications and event receivers only work in the GAC.
Allows for multiple versions of the dll to exist in the GAC provided versioning is used. 
Assemblies deployed to the GAC available to all of the web applications

Bin:
Deploying to the bin minimises permissios
runs with the trust level specified for the web application (standard or custom CAS policy).
Can change the level of permissions for dll's in the bin using CAS policies. (Code Access Security)
SharePoint has 2 policys/ Trust levels default: WSS_Minimal or WSS_Medium (same options as in MOSS)
Can also use ASP.NET's policies, there are about 5 of these policies in .NET and the highest level is the "Full Trust" CAS policy. ( Full, High, Medium, Low, Minimal)
Change the CAS relating to you dll's in the bin via your applications web.config.
Only code that runs in the IIS workprocess can be placed in the bin.
Bin deployment can't have multiple versions.
Assemblies deployed to the bin folder are local to the given web application
The trust levels are defined in security policy files, wss_minimaltrust.config and wss_mediumtrust.config. 
Location: local_drive:\Program Files\Common Files\Microsoft Shared\web server extensions\60\config 

Refer : oneTwo 

If deployed in one web application BIN folder and want to extend/ deploy to another web application:

Upgrade SharePoint Server

CA -> Upgrade and Migration ->  Upgrade and Patch Management -> Enable Enterprise Features -> Enter Key
To enable feature in all sites:
Upgrade and Patch Management -> Enable Features on Existing Sites -> Enable all sites in this installation to use the following set of features
Powershell : Enable-SPFeature -Identity FeatureGUID -URL WebAppURL

Different between list & document library

Lists:
Can have attachments(Not indexed), Have major versions only, Do not have Check-in/Check-out features, Not have document set, No open with explorer, No folder, List content Type
SPAttachmentCollection.Add(string, byte[]) only accepting a byte[], means the attachment must fit entirely in one continuous block memory
Libraries:
Cannot have attachments (files are directly in the library), DocumentLibrary Content Type
Have both minor (draft) and major (published) versioning
Have Check-in/Check-Out, Publishing Libraries can use Page Layouts
Have Unique Document Ids out of the box, No 'Read Access' setting, 
SPFileCollection.add(string, stream): means the content can be in memory, a stream, disk or even a TCP/IP socket.

Ads