Download the PHP package steperlin/flarum-service-worker-cache without Composer

On this page you can find all versions of the php package steperlin/flarum-service-worker-cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flarum-service-worker-cache

Flarum Service Worker Cache Extension

🚀 强大的Flarum缓存扩展 - 通过Service Worker技术实现智能缓存,显著提升论坛性能和用户体验

🆕 Flarum 2.0 Beta 支持

✨ 新特性: 本扩展已全面兼容 Flarum 2.0.0 Beta,包括:

📄 升级指南: 查看 FLARUM_2.0_UPGRADE.md

✨ 核心特性

📦 安装方式

⚠️ 当前状态:此扩展正在准备发布到Packagist,目前请使用本地安装方法。

方式一:本地安装(当前推荐)

1. 克隆项目

2. 配置本地仓库

3. 安装扩展

4. 完成! ⚡ 零配置 - 扩展会自动注册所有必要的组件,无需修改任何配置文件!

📄 详细安装指南:查看 LOCAL_INSTALL.md

方式二:标准Composer安装(即将可用)

🚀 快速验证

安装完成后,按 F12 打开浏览器开发者工具,查看Console面板:

看到以上日志说明安装成功!

📊 缓存策略详解

资源分类缓存

资源类型 缓存策略 有效期 说明
API数据 缓存优先+后台刷新 5分钟 立即返回缓存,后台更新
HTML页面 缓存优先+后台刷新 24小时 保证CSRF令牌有效性
静态资源 缓存优先+后台刷新 7天 JS/CSS/字体文件
图片资源 缓存优先+后台刷新 30天 支持CDN和外部图片

智能域名处理

🔧 缓存管理

内置控制台

访问 用户设置 > Service Worker 缓存控制台 查看:

API接口

扩展提供RESTful API用于缓存状态查询:

🛡️ 技术实现

架构设计

核心组件

  1. RegisterServiceWorker - 中间件,处理SW文件请求
  2. AddServiceWorkerAssets - 事件监听器,注入前端资源
  3. ServiceWorkerSettings - 用户界面组件
  4. service-worker.js - 核心缓存逻辑

🔍 故障排除

常见问题

Q: Service Worker未注册成功? A: 检查HTTPS环境,Service Worker需要安全上下文

Q: 缓存没有生效? A: 打开开发者工具,检查Console日志和Network面板

Q: 更新后缓存未刷新? A: 使用缓存控制台的"强制刷新SW"功能

调试技巧

🔧 系统要求

Flarum 2.0 Beta

Flarum 1.x (传统支持)

📈 性能指标

经测试,使用本扩展后:

🐛 问题反馈

遇到问题?欢迎反馈:

📝 开源协议

本项目基于 Apache-2.0 协议开源

🙏 致谢

感谢Flarum社区的支持和贡献者们的辛勤付出!


❤️ 如果这个扩展对你有帮助,请给个Star支持一下!


All versions of flarum-service-worker-cache with dependencies

PHP Build Version
Package Version
Requires flarum/core Version ^2.0.0@beta
php Version >=8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package steperlin/flarum-service-worker-cache contains the following files

Loading the files please wait ...