定制 agonyz/contao-page-speed-insights-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

agonyz/contao-page-speed-insights-bundle

最新稳定版本:2.0.2

Composer 安装命令:

composer require agonyz/contao-page-speed-insights-bundle

包简介

Automatically get page speed insights for pages

README 文档

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 your config/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.

psibundle

统计信息

  • 总下载量: 37
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2022-07-30