<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Performance Optimization on seth-shi</title><link>https://sethix.com/tags/performance-optimization/</link><description>Recent content in Performance Optimization on seth-shi</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Wed, 26 May 2021 16:54:46 +0800</lastBuildDate><atom:link href="https://sethix.com/tags/performance-optimization/index.xml" rel="self" type="application/rss+xml"/><item><title>How to Remove the Core Service - Views in Laravel</title><link>https://sethix.com/posts/2021052616/</link><pubDate>Wed, 26 May 2021 16:54:46 +0800</pubDate><guid>https://sethix.com/posts/2021052616/</guid><description>Previous article: Speed Up Your Service Performance by Reducing Service Provider Boot Time 2.0 A reader mentioned errors when directly removing the View service. This article demonstrates how to properly remove the View service. Step-by-Step Guide 1. Create a New Laravel Project composer create-project laravel/laravel=7.* laravel-demo 2. Modify the Default Route Edit routes/web.php to return JSON instead of a view:
Route::get(&amp;#39;/&amp;#39;, function () { return [ &amp;#39;code&amp;#39; =&amp;gt; 200, &amp;#39;msg&amp;#39; =&amp;gt; &amp;#39;hello&amp;#39; ]; }); 3.</description></item><item><title>Optimizing Laravel Performance by Reducing Service Providers Boot 2.0</title><link>https://sethix.com/posts/2021052512/</link><pubDate>Tue, 25 May 2021 12:08:42 +0800</pubDate><guid>https://sethix.com/posts/2021052512/</guid><description>Performance has always been one of the most discussed topics in Laravel, yet it has brought fresh perspectives to many PHP developers. Let&amp;rsquo;s optimize this framework once again.
Fundamentals (Common Knowledge) Use Redis drivers for caching, sessions, and queues Framework built-in caching: Route caching: php artisan route:cache Configuration caching: php artisan config:cache Implement caching based on API idempotency Upgrades OPcache: Enable it without hesitation Set opcache.validate_timestamps=0 to prevent automatic code updates in production (similar to compiled languages).</description></item><item><title>Speed Up Your Framework: How to Reduce Service Provider Boot Time</title><link>https://sethix.com/posts/2019032219/</link><pubDate>Fri, 22 Mar 2019 19:32:57 +0800</pubDate><guid>https://sethix.com/posts/2019032219/</guid><description>Laravel has a powerful feature called service providers that makes it easy to access various services. However, this convenience comes at the cost of framework bloat. Here&amp;rsquo;s how to optimize unnecessary service providers.
Step 1: Identify Unnecessary Service Providers Run php artisan package:discover or composer dump-auto to see all auto-loaded service providers:
Service Providers Step 2: Conditionally Load Providers Example 1: Admin Panel Optimization The encore/laravel-admin package (a backend panel) boots on every request.</description></item></channel></rss>