Class ClientResourceComparer
Client resource comparer that is used to order client resources to guess the best resource loading sequence in the browser. Usually is used for initial simple sorting before sorting by dependencies.
Inheritance
System.Object
ClientResourceComparer
Implements
System.Collections.Generic.IComparer<ClientResource>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Framework.Web.Resources
Assembly: EPiServer.Framework.dll
Version: 8.11.0Syntax
public class ClientResourceComparer : IComparer<ClientResource>
Remarks
The following order of client resources on the page is considered as "the best" sequence when resources can be loaded by browser in parallel:
- Static CSS references.
- Inline CSS blocks.
- Inline HTML injections.
- Static JavaScript references.
- Inline JavaScipt blocks.
Properties
Default
Gets the default client resource comparer.
Declaration
public static ClientResourceComparer Default { get; }
Property Value
Type | Description |
---|---|
ClientResourceComparer |
Methods
Compare(ClientResource, ClientResource)
Compares two client resources and returns a value indicating whether one should be rendered before the other.
Declaration
public int Compare(ClientResource x, ClientResource y)
Parameters
Type | Name | Description |
---|---|---|
ClientResource | x | The first client resource to compare. |
ClientResource | y | The second client resource to compare. |
Returns
Type | Description |
---|---|
System.Int32 | Value
Condition
Less than zero
|
Implements
System.Collections.Generic.IComparer<T>