• 搜索
  • 夜间模式
    ©2025-2026  技术杂货铺 Theme by OneBlog

    技术杂货铺博客

    搜索
    标签
    # npm # authentik # ddns # wg-easy # v2ray
  • 首页>
  • 技术>
  • 正文
  • Typecho缓存插件使用教程

    2026年04月09日 5 阅读 0 评论 2793 字

    一、在1panel安装redis
    并记得密码
    二、上传插件到typecho的插件路径
    usr/plugins/RedisCache
    三、配置RedisCache
    Redis主机要写:redis
    Redis端口:6379
    Redis密码服务器上获取。其他的默即可
    四、1panel的redis常用命令
    1、查看缓存:KEYS typecho_cache:*
    如下示例,有三个缓存
    127.0.0.1:6379> KEYS typecho_cache:*
    1) "typecho_cache:f15cd63fa3bf3edc387e8698ec987101"
    2) "typecho_cache:4e08d8667b8060773e6054291d19350f"
    3) "typecho_cache:684fd3bde35037f020e81d9a4bc6bb44"
    127.0.0.1:6379>
    2、查看命中率:INFO stats
    如下示例:
    keyspace_hits (命中) 40
    keyspace_misses (未命中) 13
    total_net_output (输出流量) 2.61 MB
    具体数据:
    127.0.0.1:6379> INFO stats

    Stats

    total_connections_received:70
    total_commands_processed:159
    instantaneous_ops_per_sec:0
    total_net_input_bytes:103276
    total_net_output_bytes:2609080
    total_net_repl_input_bytes:0
    total_net_repl_output_bytes:0
    instantaneous_input_kbps:0.00
    instantaneous_output_kbps:0.00
    instantaneous_input_repl_kbps:0.00
    instantaneous_output_repl_kbps:0.00
    rejected_connections:0
    sync_full:0
    sync_partial_ok:0
    sync_partial_err:0
    expired_subkeys:0
    expired_subkeys_active:0
    expired_keys:5
    expired_keys_active:5
    expired_stale_perc:0.00
    expired_time_cap_reached_count:0
    expire_cycle_cpu_milliseconds:2595
    evicted_keys:0
    evicted_clients:0
    evicted_scripts:0
    total_eviction_exceeded_time:0
    current_eviction_exceeded_time:0
    keyspace_hits:40
    keyspace_misses:13
    pubsub_channels:0
    pubsub_patterns:0
    pubsubshard_channels:0
    latest_fork_usec:313
    total_forks:5
    migrate_cached_sockets:0
    slave_expires_tracked_keys:0
    active_defrag_hits:0
    active_defrag_misses:0
    active_defrag_key_hits:0
    active_defrag_key_misses:0
    total_active_defrag_time:0
    current_active_defrag_time:0
    tracking_total_keys:0
    tracking_total_items:0
    tracking_total_prefixes:0
    unexpected_error_replies:0
    total_error_replies:11
    dump_payload_sanitizations:0
    total_reads_processed:238
    total_writes_processed:191
    io_threaded_reads_processed:0
    io_threaded_writes_processed:0
    io_threaded_total_prefetch_batches:0
    io_threaded_total_prefetch_entries:0
    client_query_buffer_limit_disconnections:0
    client_output_buffer_limit_disconnections:0
    reply_buffer_shrinks:22
    reply_buffer_expands:1
    eventloop_cycles:696641
    eventloop_duration_sum:103334036
    eventloop_duration_cmd_sum:11120
    instantaneous_eventloop_cycles_per_sec:8
    instantaneous_eventloop_duration_usec:153
    acl_access_denied_auth:0
    acl_access_denied_cmd:0
    acl_access_denied_key:0
    acl_access_denied_channel:0
    acl_access_denied_tls_cert:0
    127.0.0.1:6379>
    关键结论:
    命中率依然稳定:目前的总命中率约为 75.4% ($40 / (40 + 13)$)。虽然比刚才的 80% 略微掉了一点点,但这属于正常波动,通常是因为你刚才点击了几个还没被缓存过的新页面(产生了 4 次新的 Miss)。
    吞吐量健康:你的流量输出(total_net_output_bytes)从 2.1MB 涨到了 2.6MB,这意味着这几次 Hit 帮你的服务器节省了大约 0.5MB 的动态渲染输出压力。
    Key 没有无限增长:expired_keys 依然是 5,说明旧的缓存还在有节奏地过期,Redis 里的 Key 数量维持在一个很健康的水平。

    本文著作权归作者 [ 爱生活的懒人 ] 享有,未经作者书面授权,禁止转载,封面图片来源于 [ 互联网 ] ,本文仅供个人学习、研究和欣赏使用。如有异议,请联系博主及时处理。

    发表留言
    回复

    Copyright©2025-2026  All Rights Reserved.  Load:0.013 s
    Theme by OneBlog V3.6.5
    夜间模式

    开源不易,请尊重作者版权,保留基本的版权信息。