What is intervention: "Modified page load behavior on the page because the page was expected to take a long amount of time to load"?

What is intervention: "Modified page load behavior on the page because the page was expected to take a long amount of time to load"?
Photo by Icons8 Team / Unsplash

At URIports, we process a lot of Reporting API intervention reports containing the following violation:

Modified page load behavior on the page because the page was expected to take a long amount of time to load

Intervention violations can cause unwanted behavior and are visible in the visitors' developer console. Additionally, browsers can send violation reports to alert website administrators using the Reporting API. This allows web developers to resolve these violations proactively and monitor how frequently they occur.

đź’™
Get clear, real-time insight into the health and performance of your website with URIports
Monitor violations, network errors, certificate issues, deprecated code, and more without installing additional scripts or software.
Read more

What is the intervention violation about?

On web pages that are expected to load slowly, the browser Google Chrome may modify loading behavior to provide a faster page load to Lite Mode (Data Saver) users. This behavior modification can take many forms including but not limited to: blocking specific resources, loading partial resources, loading a previously saved version of the page, using Google servers to rewrite pages, etc. An intervention report is sent when this optimization occurs.

Google Chrome may use the following optimalizations to speed up your site for users that are using slow connections:

1. Showing an offline copy

When users are on slow connections, Chrome will show an offline copy of a page if there is an offline version of the page available on the user’s device. Users will be shown a lite mode UI in the omnibox. If Chrome determines the network has 2G speeds and there's an offline page stored, Chrome shows the offline page. Chrome’s offline pages are based on MHTML snapshots.

2. Prevent automatic loading of images

If a Data Saver user is on a 2G-speed or slower network according to the NetInfo API, Chrome replaces images with placeholders and sends an intervention header on every resource request. Placeholders are the same dimensions as the original image to maintain site layout. Users are shown a Lite Mode UI in the omnibox. Users can load the image by long-pressing on the placeholder, or load all images by tapping “Show original” in the UI. An intervention report is sent when this optimization occurs.

3. Disable scripts

If a Data Saver user is on a 2G-speed or slower network according to the NetInfo API, Chrome disables scripts and sends an intervention header on every resource request. Users are shown a Lite Mode UI in the omnibox. Users can enable scripts on the page by  tapping “Show original” in the omnibox UI. An intervention report is sent when this optimization occurs.

4. Only show JS and CSS resource needed for the visual appearance

On webpages that are expected to load slowly, stop loading of non-critical resources. This includes (but is not limited to) JavaScript and CSS resources that do not contribute significantly to the visual appearance. This would be limited to only the data saver users. Users are shown a Lite Mode UI in the omnibox. Users can load default behavior by tapping “Show original” in the omnibox UI. An intervention report is sent when this optimization occurs.

How to fix this violation

If you receive many violations like this, it may indicate that many of your site visitors have a slow internet connection or your website is too resource intensive. Therefore, it might be good to investigate if you can optimize your site to be more resource or bandwidth-friendly.

Monitor this and many other violations on your site

If you want to monitor these violations, check out our monitoring platform URIports. With our service, you can monitor network traffic, network disruptions, content security policy violations, and much much more!

If you have any questions about this subject, please drop me a line at @roelandkuiper or @uriports