Front end optimization
-
Reducing the number of requests.
-
Required for rendering each page.
-
Reducing the number of bytes in page responses.
Optimizations performed by the FEO feature
| Web Optimization | Problem | What NetScaler FEO feature does | Benefits |
|---|---|---|---|
| Inlining | Client browsers often send multiple requests to servers for loading external CSS, images, and JavaScript associated with the webpage. | CSS inline, JavaScript inline, CSS combine | Loading the external CSS, images, and JavaScript inline with the HTML files improves page-rendering time. This optimization is beneficial for content that is viewed only once, and for mobile devices that have limited cache sizes. |
| Minification | Data fetched from servers includes inessential characters such as white spaces, comments, and newline characters. The time that browsers spend in processing such data creates website latency. | CSS minification, JavaScript minification, Removal of HTML comments | Minified files consume less bandwidth and avoid the latency caused by special processing. |
| Image optimization | Mobile browsers often have slow connection speeds and limited cache memory. Downloading the images on mobile clients consumes more bandwidth, processing time, and cache space, resulting in website latency. | JPEG optimization, CSS image inlining, Image shrink-to attributes, GIF to PNG conversion, HTML image inlining, WebP image conversion, JPEG, GIF, PNG to JPEG-XR image conversion | Reduces the image to the size indicated in the image tag by NetScaler, enabling client browsers to load images faster. |
| Repositioning | Inefficient processing of external CSS, images, and JavaScript increases page-load time. | Image lazy loading, CSS move to Head, JavaScript move to end | Repositions HTML elements, to reduce rendering time for webpages and enable client browsers to load the objects faster. |
| Connection Management | Many browsers set limits on the number of simultaneous connections that can be established to a single domain. This can cause browser to download webpage resources one at a time, resulting in higher browser time. | Domain sharding | Overcomes the connection limitation, which improves page-rendering time by enabling client browser to download more resources in parallel. |
How front end optimization works
-
Parses the contents of the page, creates an entry in the cache (wherever applicable), and applies the FEO policy.For example, a NetScaler can apply the following optimization rules:
-
Remove white spaces or comments present within a CSS or JavaScript.
-
Combine one or more CSS files to one file.
-
Convert GIF image format to PNG format.
-
-
Rewrites the embedded objects and saves the optimized content in the cache, with a different signature than the one used for the initial cache entry.
-
For subsequent requests, fetches the optimized objects from the cache, not from the server, and forwards the responses to the client.
Configure front end optimization
Prerequisites
-
Allocate cache memory.
-
Set the maximum response size and memory limit for a default cache content group.
Configure front end optimization by using NetScaler command interface
-
Enable the front end optimization feature.
enable ns feature FEO
-
Create one or more front end optimization actions.
add feo action <name> [-imgShrinkToAttrib] [-imgGifToPng] ...
add feo action allact -imgGifToPng -pageExtendCache
set feo parameter [-cacheMaxage <integer>] [-JpegQualityPercent <integer>] [-cssInlineThresSize <integer>] [-inlineJsThresSize <integer> [-inlineImgThresSize <integer>]
set feo parameter -cacheMaxage 10
-
Create one or more front end optimization policies.
add feo policy <name> <rule> <action>
>add feo policy pol1 TRUE all act
>add feo policy pol1 "(HTTP.REQ.URL.CONTAINS(\"testsite\"))" allact1
-
Bind the policy to a load balancing or content switching virtual server, or bind it globally.
bind lb vserver <name> -policyName <string> -priority <num>
bind cs vserver <name> -policyName <string> -priority <num>
bind feo global <policyName> <priority> -type <type> <gotoPriorityExpression>
> bind lb vserver abc -policyName pol1 -priority 1 -type NONE
> bind feo global pol1 100 -type REQ_DEFAULT
-
Save the configuration. save ns config
Configure front end optimization by using the GUI
-
Navigate to Optimization > Front End Optimization > Actions, and click Add and create a front end optimization action by specifying the relevant details.
-
Navigate to Optimization > Front End Optimization, and on the right-pane, under Settings, click Change Front End Optimization settings and specify the front end optimization global settings.
-
Create a front end optimization policy.
-
Navigate to Optimization > Front End Optimization > Policies, click Add and create a front end optimization policy by specifying the relevant details.
-
Bind the policy to a load balancing or content switching virtual server.
-
Navigate to Optimization > Front End optimization > Policies.
-
Select a front end optimization policy and click Policy Manager.
-
Under Front End Optimization Policy Manager, bind the front end optimization policy to a load balancing or content switching virtual server.
-
Verify front end optimization configuration
View FEO statistics by using the CLI
-
stat feoNote: The stat feo policy command displays statistics only for advanced FEO policies. -
show feo policy name -
stat feo -detail
View FEO statistics on NetScaler dashboard
-
Select Front End Optimization to display a summary of
FEOstatistics. -
Click the Graphical View tab to display the rate of requests processed by the FEO feature.