性能负优化 – 博客更新(一百一十九)

5993°C 26-01-2024 notbyai
最近更新于:2024-01-26 17:07:55

文章摘要moonshot-v1-8k

Standby API Responsing..

自版本 v1.3.8.6 变更优化主题目录结构后,偶然几次测试 lighthouse 发现分数骤降到 70+,然后普通访问页面的时候能直接感觉到那种>1s的延迟停顿感(就是那种点击后要延迟<1s而不是直接跳转加载,体验极差),反复变更测试后台函数无果,这真是离谱他妈给离谱开门了。我一直以为是结构优化出了问题(因为目前变更后每次调用模板都会扫一遍指定 templates 目录而不是默认载入的根目录,看后面要不要调回来)

后面搞半天也没啥效果,时好时坏的,今天调试 php8.0 测试站的时候发现体感速度非常快(虽然测试站内容少,想起去服务端看看缓存配置,8.0是正常配置,但突然一眼发现主站目前的 php 版本是 7.4(因为之前一直用的配置好的 7.3),马上想到是不是上次切换版本后没开缓存?结果一看还真是… 马上配置起来,再次访问测试一下就变快了(体感<1s,点击后立刻反应),我寻思这玩意还真好用(虽然没以前<0.5s瞬间打开那么快,极可能是 v1.3.8.6 的模板结构扫描变更导致,如果是该原因那么这变更很可能会在后续版本进行回退。

Ps.

opcache 和 memcached 效果显著确实好用,开和不开是两种体验,建议 php 后端的都开起来。


评论留言

avatar
「 涂鸦画板 」 关闭表情 bilibili 小电视
h0h1h2h3h4h5h6h7h8h9h10h11h12h13h14h15h16h17h18h19h20h21h22h23h24h25h26h27h28h29h30h31h32h33h34h35h36h37h38h39h40h41h42h43h44h45h46h47h48h49h50h51h52h53h54h55h56h57h58h59h60h61h62h63
5 条评论
user_avatar
Flipaclip online Chrome / Windows 10
2025-09-19 回复

“Really insightful post! It’s fascinating to see how optimizing PHP configurations and enabling caching systems like OPcache and Memcached can drastically improve website performance. The author’s experience with the v1.3.8.6 theme update and the subsequent performance issues highlight the importance of considering server-side configurations when making frontend changes. Thanks for sharing this practical advice — it’s a great reminder that performance optimization is a holistic process!”

user_avatar
姜辰Jcs.Moe Chrome / Unknown
2024-02-16 回复

以前我喜欢给网站开缓存Memcached,后来发现,还不如不开。41

user_avatar
obaby Chrome / macOS 10.15
2024-01-26 回复

opcache 效果还是可以的,不过我用的是 7.4 貌似