Today we are introducing a major upgrade to our caching and acceleration. This upgrade will pop the hood on Incapsula’s default settings, providing our users with the ability to fine-tune Incapsula’s caching settings and optimization methodologies in a way most suited to their specific needs.
This is a step away from our typical product philosophy, which always focused on providing complete automation and hands-free solutions. However, with the wide adoption of CDN technology, we feel that our SMB and enterprise clients are becoming well acquainted with the principals behind Incapsula’s acceleration features and can benefit from some manual steering, in addition to our auto-piloting.
Today, with our new acceleration control options, our clients will have the added flexibility to enjoy the best of both worlds.
New Acceleration Control Options
Incapsula’s new controls represent a splitting up of Incapsula’s existing acceleration capabilities, which were previously managed by automated optimization algorithms. While these algorithms still provide the backbone for our system, the new controls augment them by allowing users to manage the following individual features:
These configurations allow you to determine how your site’s content is being cached and refreshed. The available modes are:
- Disable Caching – all content is transferred from your web server.
- Static Only – caching only the content that was marked as static by standard HTTP headers.
- Static + Dynamic – using proprietary learning algorithms, Incapsula auto-optimizes HTTP headers to cache all available static resources and non-changing dynamically generated resources. The algorithms are designed to monitor freshness. The time period option (in minutes, hours, days or weeks) determines how often the cache is refreshed.
- Aggressive – all content is cached and served from proxy. The time period option determines how often the cache is renewed. This mode is recommended for static HTML sites. It can also be used to present cached copy of the site, even when the site is down. However, such copies could be unreliable and such usage is not advised.
NOTE: You may be familiar with an older version of this feature called Acceleration Mode, which was previously found under “General Settings”. The possible modes were:
- Off – now implemented as the ‘Disable Caching’ mode.
- Standard – now implemented as the ‘Static Only’ mode.
- Advanced – now implemented as the ‘Static + Dynamic’ mode.
These options allow manual purging of the entire cache or specific cached resources to instantly propagate content changes.
- Purge Cache – refreshes all cached resources.
- Purge Specific Resources – refreshes all cached objects for a specific URL. Comes with wildcard support for easy bulk management.
Advanced Caching Rules
Advanced Caching Rules allow you to define exceptions to the general caching settings of your current caching mode. You can enforce these rules on a specific URL or choose entire URL groups using a wildcard selection. Options include:
- Always Cache – an easy way to mark static resources override. This option can also be used to override “no-cache” and ‘max-age=0’ directives on cacheable dynamically generated resources.
- Never Cache – useful for staging areas and other frequently edited internal environments.
Precedence among Caching Rules
- ‘Never cache’ advanced rules
- ‘Always cache’ advanced rules
- Caching Mode rules
- Cache directives sent by the web server
Minification reduces file size by removing unnecessary characters (such as whitespace and comments) to decrease access time without impacting functionality.
Using Incapsula’s new acceleration controls you can choose the type of resources you wish to minify – JS, CSS or static HTML files. Note that minification can only be applied to cached objects; therefore this option is disabled when caching is disabled.
Image compression can be applied to JPEG and PNG images to reduce load times. With compression enabled, image metadata is omitted and the image data itself is compressed, which in certain cases may affect image quality.
In the case of JPEG compression, there are two additional options to choose from:
- Progressive Image Rendering – the image appears faster and is rendered with progressively finer resolution, for additional compression. During the rendering stage the image may appear “pixelated” but the final version will appear with no loss of quality.
- Aggressive Compression – applies a more aggressive compression. Selecting this option will further reduce the image file size and its loading time at the cost of decreased image quality.
Both of these options are best suited for sites that do not use web formats for images, scale images through HTML/CSS code and ignore other image handling best practices.
“On the Fly” Compression
When this option is enabled, text files (JS, CSS and HTML) are gzipped before being transferred to reduce loading times. Gzipping is a common best practice which significantly accelerates page load speeds, reducing the compressed file sizes by 30%-40% or more, depending on the size and type of the file. For this reason, ‘On the Fly’ compression is always advised and is most effective for larger resources.
Async validation controls the transition between cached copies that occurs once the caching period has expired.
With Async validation off, the first request of each caching cycle is served from origin server, which ensures freshness at the cost of load speed. With Async validation on, the first request is served from cache, which will update asymmetrically as the request is being processed. This impacts freshness but provides better time-to-first-byte (TTFB) and improves overall performance.
Choosing between these options depends on the nature of the site. Rapidly updating sites should avoid asymmetric caching, while more static sites may choose to embrace it, to ensure smooth handoff between caching cycles.
By default, a web session may open and close many TCP connections dynamically throughout the session, causing a certain overhead and reducing performance. With TCP Pre-Pooling enabled, Incapsula maintains several TCP connections constantly open throughout the session, thereby improving load speeds and connectivity.
Note: Not all web hosts support TCP pre-pooling. In such a case, enabling pre-pooling on an unsupported platform may result in a slight slowdown.
Incapsula uses learning heuristics to transparently identify and prevent such scenarios. However, before turning this feature on, you may want to check with your hosting provider.
Advanced caching settings allow you to control header directives that may interfere with Incapsula’s caching behavior, thereby reducing performance. The advanced options include:
- Observe no-cache and maxage – enabling this option enforces ‘purge cache’ requests (e.g., Ctrl+F5 ) from website visitors. When dealing with CDNs, such requests are often redundant, as they purge the already static content on proxy – causing service degradation and wasting bandwidth without providing any real benefit in terms of content freshness, which is already handled on the CDN level. This option is turned off by default.
- Observe vary – enabling this option prevents caching for all resources marked with ‘vary’ HTTP headers. Such headers are often implemented incorrectly and indiscriminately, which leads to CDN compatibility issues. This option is turned off by default.
Keep your finger on the pulse
Sign up for updates from Imperva, our affiliated entities and industry news.
Keep your finger on the pulse
Sign up for Imperva updates and industry news and never miss a beat.