Extension for the Contao CMS
This extension can be used to automatically track the page speed insights for your root domains.
For a Quick-Setup follow this link: Guide-For-Quick-Setup
Run composer require agonyz/contao-page-speed-insights-bundle
in your CLI to install the extension.
To use the Page Speed Insights API you need to register an Api Key.
You can edit the configuration in your config/config.yml
# config/config.yml
# Agonyz Page Speed Insights
agonyz_contao_page_speed_insights:
api_key: your-secret-api-key
request_retries: 3 # retries for each strategy (desktop & mobile)
pool_request_concurrency: 10 # indicates how many requests are sent simultaneously
request_pagination: 15 # indicates how many requests are shown in the overview per page
request_status_refresh_rate: 5000 # duration for the ajax request to check the status of the current process
Please remember to always clear the cache after each change in the config.yml
.
It may be also needed to delete the cached results via command after changes in the config file.
In the root page configuration navigate to Page Speed Insights Bundle
and tick the checkbox.
agonyz-page-speed-insights:request
- generates new request results and saves them to the database
You can either implement your own cronjob or use contao cron
- Create a cronjob that executes the
agonyz-page-speed-insights:request
- Command
- Configurate
Agonyz\ContaoPageSpeedInsightsBundle\Cron\PageSpeedInsightsCron
in yourconfig/services.yml
Example:
# Cronjob
services:
Agonyz\ContaoPageSpeedInsightsBundle\Cron\PageSpeedInsightsCron:
tags:
-
name: contao.cronjob
interval: '0 */24 * * *'
arguments:
[ '@contao.framework', '@Agonyz\ContaoPageSpeedInsightsBundle\Service\Request\RequestHandler']
Documentation: https://docs.contao.org/dev/framework/cron/#using-service-tagging
In the backend navigate to the Pagespeed-Insights
- entry point.