承接 dan0sz/resource-hints-magento2 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

dan0sz/resource-hints-magento2

Composer 安装命令:

composer require dan0sz/resource-hints-magento2

包简介

Add `<link rel='preconnect'>`, `<link rel='dns-prefetch'>`, `<link rel='prefetch'>`, or `<link rel='preload'>` resource hints to Magento 2's head.

README 文档

README

If it doesn't work on your Magento 2 instance, please fork this repo and fix it -- and feel free to submit a PR to add your changes to this repo.

Update January 31st, 2022: I've removed the Magento version requirements from composer.json so that you can try it on any instance. I'm not guaranteeing it'll work.

Resource Hints for Magento 2

Overview

Add <link rel='preconnect'>, <link rel='dns-prefetch'>, <link rel='prefetch'>, or <link rel='preload'> resource hints to Magento 2's head.

Features

  • Tweak your Magento 2 store's performance by adding custom preconnect, dns-prefetch, prefetch, and preload headers.
  • Enable/disable crossorigin attribute.
  • Easily configurable at default, website and store view level (incl. sort order).

Installation

Using Composer

Installation using Composer is easy and recommended. From a terminal, just run:

composer require dan0sz/resource-hints-magento2

Manually

If you can't or dont want to use Composer, you can download the master-branch of this repository and copy the contents to app/code/Dan0sz/ResourceHints.

After installation

Developer Mode

  • Run bin/magento setup:upgrade
  • Done!

Production Mode

  • Run bin/magento setup:upgrade
  • Run bin/magento setup:di:compile
  • Run bin/magento setup:static-content:deploy [locales e.g. en_US nl_NL]
  • Done!

Configuration

After installation a new tab is added to Stores > Configuration > General > Web called Resource Hints.

How does it work?

While most settings of this extension speak for themselves. The Resource column contains a few nifty tricks (thanks to @chedaroo), which will come in handy when e.g. Static content signing is enabled.

Values in the Resource column are assumed to be relative (local) assets. When a relative path is entered and Static Content Signing is enabled, e.g.

(In these examples it is assumed that the default theme, Magento Luma is used.)

  • YourName_ModuleName::path/to/file.ext will resolve to https://yourdomain.tld/static/<<deployment_version>>/frontend/Magento/luma/en_US/YourName_ModuleName/path/to/file.ext, and
  • path/to/file.ext will resolve to https://yourdomain.tld/static/<<deployment_version>>/frontend/Magento/luma/en_US/path/to/file.ext.

When Static Content Signing is disabled, the above mentioned values will resolve to:

  • https://yourdomain.tld/static/frontend/Magento/luma/en_US/YourName_ModuleName/path/to/file.ext, and
  • https://yourdomain.tld/static/frontend/Magento/luma/en_US/path/to/file.ext respectively.

When absolute URLs (prefixed by a protocol, i.e. http://, https:// or //) are entered in the Resource column, no prior resolving will take place. E.g.

  • http://yourdomain.tld/path/to/file.ext,
  • https://yourdomain.tld/path/to/file.ext, and
  • //SomeVolume/path/to/file.ext.

The examples above will all resolve to the same exact URL.

dan0sz/resource-hints-magento2 适用场景与选型建议

dan0sz/resource-hints-magento2 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 100.11k 次下载、GitHub Stars 达 21, 最近一次更新时间为 2019 年 08 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 dan0sz/resource-hints-magento2 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 21
  • Watchers: 2
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: CC-BY-4.0
  • 更新时间: 2019-08-27