chi-teck/sample_catalog 问题修复 & 功能扩展

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

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

chi-teck/sample_catalog

Composer 安装命令:

composer require chi-teck/sample_catalog

包简介

A sample module to proof concept of parallel rendering content in Drupal.

关键字:

README 文档

README

Introduction

The Sample Catalog module provides a sandbox environment for testing and analyzing the performance of building content in Drupal. It offers configurable stress-testing settings and a sample catalog with product panes to evaluate the impact of various optimization techniques. This module is designed for developers who want to understand and experiment with Drupal's performance under different conditions.

Catalog screenshot

Usage

  • Configuration page: /admin/config/development/sample-catalog
  • Catalog page: /catalog

The catalog is a collection of panes built with plugins called ProductPaneBuilder. The module ships with a few builders that demonstrate different approaches for building content in Drupal.

Built-in Builders

Currently, there is no UI for configuring pane builder plugins. Use settings.php as described below.

1. Simple

This builder creates content in a single thread, which is the typical approach for most Drupal sites.

$build = [];
foreach ($products as $product) {
  $build[] = $this->build($product);
}

Configuration

No options.

2. FPM

The FPM plugin relies on the Fast CGI Client and allows you to build panes in background workers without requiring any extra extensions.

To get the most out of this plugin, make sure the corresponding PHP-FPM pool is configured with a sufficient number of workers.

Configuration

$settings['sample_catalog']['fpm']['server_address'] = 'tcp://php:9000';
// Unix sockets are also supported.
$settings['sample_catalog']['fpm']['server_address'] = 'unix:///var/run/php-fpm.sock';

3. Process

This builder creates each pane in a separate PHP CLI process.

Configuration

No options.

4. HTTP

This builder delegates the construction of panes to an external HTTP server. The server must provide the following endpoint:

Request: GET /product/{product_id}
Response: Serialized render array for the product pane

Although the module itself provides such an endpoint (/sample-catalog), it's recommended to configure a separate multi-threaded application server that boots Drupal once and stays in memory (RoadRunner, FrankenPHP, etc.).

Configuration

$settings['sample_catalog']['http']['base_uri'] = 'http://localhost:8080/sample-catalog';

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2024-11-11