agonyz / contao-page-speed-insights-bundle
Automatically get page speed insights for pages
Installs: 37
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Type:contao-bundle
Requires
- php: ^7.4 || ^8.0
- babdev/pagerfanta-bundle: ^3.7
- contao/core-bundle: ^4.13
- guzzlehttp/guzzle: ^7.4
- pagerfanta/doctrine-orm-adapter: ^3.6
- pagerfanta/twig: ^3.6
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.5
- contao/easy-coding-standard: ^5.3
- contao/manager-plugin: ^2.0
- phpunit/phpunit: ^9.5
- symfony/phpunit-bridge: ^6.1
Conflicts
- contao/manager-plugin: <2.0 || >=3.0
README
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
Installation
Run composer require agonyz/contao-page-speed-insights-bundle
in your CLI to install the extension.
Configuration
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.
Choose which pages to track
In the root page configuration navigate to Page Speed Insights Bundle
and tick the checkbox.
Commands & Cronjob
Commands
agonyz-page-speed-insights:request
- generates new request results and saves them to the database
Cronjob
You can either implement your own cronjob or use contao cron
Via Command
- Create a cronjob that executes the
agonyz-page-speed-insights:request
- Command
Via Cron
- 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
Page Speed Insights
In the backend navigate to the Pagespeed-Insights
- entry point.