diffrentdigital/remove-html-comments
最新稳定版本:1.0.0
Composer 安装命令:
composer require diffrentdigital/remove-html-comments
包简介
A Statamic addon to remove HTML comments from responses.
README 文档
README
This Statamic add-on removes HTML comments (<!-- ... -->) from responses before they are sent to the browser, optimizing your website's output.
Features
- Automatically strips all HTML comments from
text/htmlresponses. - Lightweight middleware with minimal performance overhead.
- Seamlessly integrates with Statamic.
Installation
You can install the package via Composer:
composer require diffrentdigital/remove-html-comments
Usage
Once installed, the add-on is automatically registered in your Statamic application. It runs as middleware for all routes in the web middleware group.
How It Works
- The middleware processes all HTML responses.
- It identifies HTML comments using a regex pattern and removes them.
No additional configuration is required. 🎉
Performance Considerations
This add-on is designed to have minimal impact on performance. It only processes responses with the Content-Type header set to text/html.
Profiling
If you experience any performance concerns, you can use Laravel Debugbar or other profiling tools to measure middleware execution time.
License
This package is open-sourced software licensed under the MIT license.
Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
To Contribute:
- Fork the repository.
- Make your changes in a feature branch.
- Submit a pull request.
Acknowledgments
This add-on was created by delz-dev.
Functionality
This add-on removes HTML comments from responses, but only when the application is running in the production environment.
Support
If you find this add-on useful, please consider starring the repository on GitHub or sharing it with others. 😊
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-07