georgringer/page_speed 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

georgringer/page_speed

Composer 安装命令:

composer require georgringer/page_speed

包简介

Performance & Usability are important to any site. Check every page for it and know how the site can be improved.

README 文档

README

This extensions provides an entry in the info module to check the usability & performance of the selected page by using the API of Google PageSpeed Insights.

Every page is automatically checked for the resolution desktop & mobile.

Screenshot

Screenshot of the backend

Requirements

  • TYPO3 CMS 9.5+
  • Google Account

Installation & Configuration

The extension just needs to be installed as any other extension. To make it work, you need a Google account and activate the PageSpeed service. After successfully activating the PageSpeed service you need to set the key in the configuration in EM and deactivate the demo mode.

Enable PageSpeed Service

  1. Open console.developers.google.com and create a new project.
  2. Open the project and switch to APIs and auth > APIs, select PageSpeed Insights API and Activate the API.
  3. Switch to Credentials and click the button Create new key for public API access.
  4. Create either a Server key or a Browser key*.
  5. Test the access by using cUrl on the server where you want to use the extension by calling the command curl 'https://www.googleapis.com/pagespeedonline/v2/runPagespeed?strategy=desktop&url=http://www.bbc.co.uk/&key=AIzaSyA2rQEy7UyQz-9D1-7bnmw1jzSo0FmobYM'. (If you get a Bad request, just wait a few minutes to get the key deployed on all Google servers)

Preview Domain

If you need to use a different domain in the frontend or no sys domain record is available, you can use the following configuration inside your PageTsConfig:

TCEMAIN.previewDomain = localhost/sites/t3/master

Avoid error "require_once(Net/URL2.php)"

If you see an exception about the file Net/URL2.php not found, please open the file typo3/contrib/vendor/pear/http_request2/HTTP/Request2.php and remove the require_once statement in line 24. This bug will be gone soon.

Technical background

A little bit technical information for the ones who are interested in:

The API is described in detail at developers.google.com/speed/docs/insights/v2/reference/pagespeedapi/runpagespeed and it is very simple to test by just using curl:

# Desktop
curl 'https://www.googleapis.com/pagespeedonline/v2/runPagespeed?strategy=desktop&screenshot=true&url=http://www.typo3.org&key=<your_key>'
# Mobile
curl 'https://www.googleapis.com/pagespeedonline/v2/runPagespeed?strategy=mobile&screenshot=true&url=http://www.typo3.org&key=<your_key'

Further development

Todos

  • Record selection
  • Check if current page or rootline is restricted
  • Check if current page's translation should not be be shown
  • Auto cleanup after page cache clearing

georgringer/page_speed 适用场景与选型建议

georgringer/page_speed 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 8.14k 次下载、GitHub Stars 达 16, 最近一次更新时间为 2016 年 08 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 georgringer/page_speed 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 georgringer/page_speed 我们能提供哪些服务?
定制开发 / 二次开发

基于 georgringer/page_speed 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 8.14k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 16
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 16
  • Watchers: 4
  • Forks: 4
  • 开发语言: HTML

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2016-08-13