PageSourceSearch

https://www.yolo.blue/assets/js/d4a49fc1.2d76930a.js

js yolo.blue collected 2026-09-24 10:42:07 UTC 9,421 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkyolo=self.webpackChunkyolo||[]).push([["798"],{38555(e,n,s){s.r(n),s.d(n,{metadata:()=>r,default:()=>h,frontMatter:()=>c,contentTitle:()=>a,toc:()=>t,assets:()=>d});var r=JSON.parse('{"id":"notes/develop/web/wordpress-website-loading-optimization","title":"WordPress \u7F51\u7AD9\u52A0\u8F7D\u4F18\u5316","description":"WordPress \u7F51\u7AD9\u52A0\u8F7D\u4F18\u5316\u65B9\u6CD5\u6C47\u603B\u3002","source":"@site/docs/notes/develop/web/wordpress-website-loading-optimization.mdx","sourceDirName":"notes/develop/web","slug":"/notes/develop/web/wordpress-website-loading-optimization","permalink":"/docs/notes/develop/web/wordpress-website-loading-optimization","draft":false,"unlisted":false,"tags":[{"inline":false,"label":"WordPress","permalink":"/docs/tags/wordpress"},{"inline":false,"label":"\u5907\u5FD8\u6E05\u5355","permalink":"/docs/tags/cheat-sheet"}],"version":"current","lastUpdatedAt":1750741867000,"frontMatter":{"description":"WordPress \u7F51\u7AD9\u52A0\u8F7D\u4F18\u5316\u65B9\u6CD5\u6C47\u603B\u3002","tags":["wordpress","cheat-sheet"]},"sidebar":"docsSidebar","previous":{"title":"Page Loading Optimizations","permalink":"/docs/notes/develop/web/page-loading-optimization"},"next":{"title":"WordPress \u7F51\u7AD9 SEO","permalink":"/docs/notes/develop/web/wordpress-website-seo"}}'),i=s(74848),o=s(28453);let c={description:"WordPress \u7F51\u7AD9\u52A0\u8F7D\u4F18\u5316\u65B9\u6CD5\u6C47\u603B\u3002",tags:["wordpress","cheat-sheet"]},a="WordPress \u7F51\u7AD9\u52A0\u8F7D\u4F18\u5316",d={},t=[{value:"W3 Total Cache",id:"w3-total-cache",level:2},{value:"Page Cache",id:"page-cache",level:3},{value:"Minify",id:"minify",level:3},{value:"Opcode Cache",id:"opcode-cache",level:3},{value:"Database Cache",id:"database-cache",level:3},{value:"Object Cache",id:"object-cache",level:3},{value:"Browser Cache",id:"browser-cache",level:3},{value:"CDN",id:"cdn",level:3},{value:"Reverse Proxy",id:"reverse-proxy",level:3},{value:"User Experience",id:"user-experience",level:3},{value:"Nginx \u914D\u7F6E",id:"nginx-\u914D\u7F6E",level:2},{value:"\u4F8B\u5B50",id:"\u4F8B\u5B50",level:3}];function l(e){let n={a:"a",admonition:"admonition",code:"code",del:"del",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"wordpress-\u7F51\u7AD9\u52A0\u8F7D\u4F18\u5316",children:"WordPress \u7F51\u7AD9\u52A0\u8F7D\u4F18\u5316"})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsxs)(n.del,{children:["\u672C\u7F51\u7AD9\u91C7\u7528 ",(0,i.jsx)(n.a,{href:"https://wordpress.org/",children:"WordPress"})," \u642D\u5EFA\uFF0C\u662F\u4E00\u4E2A\u52A8\u6001\u7F51\u7AD9\uFF0C\u8BBF\u95EE\u65F6\u9700\u8981\u5B9E\u65F6\u67E5\u8BE2\u6570\u636E\u5E93\u83B7\u5F97\u6570\u636E\u6765\u751F\u6210\u9875\u9762\uFF0C\u5F80\u5F80\u9700\u8981\u597D\u51E0\u79D2\u624D\u80FD\u6253\u5F00\u9875\u9762\uFF0C\u4F53\u9A8C\u4E0D\u4F73\u3002\u7531\u4E8E\u672C\u7F51\u7AD9\u662F\u535A\u5BA2\u6027\u8D28\uFF0C\u5185\u5BB9\u66F4\u65B0\u9891\u7387\u4E0D\u9AD8\uFF0C\u53EF\u4EE5\u5C3D\u53EF\u80FD\u7684\u91C7\u7528\u9759\u6001\u5316\u9875\u9762\u4F5C\u7F13\u5B58\u7684\u7B56\u7565\u6765\u4F18\u5316\uFF0C\u4E0B\u9762\u6211\u4EEC\u5C31\u7740\u624B\u5F00\u59CB\u5427\u3002"]}),"\n\u76EE\u524D\u672C\u7F51\u7AD9\u5DF2\u7ECF\u91C7\u7528 ",(0,i.jsx)(n.a,{href:"https://docusaurus.io/",children:"Docusaurus"})," \u5B9E\u73B0\u5B8C\u5168\u9759\u6001\u5316\u3002"]}),"\n",(0,i.jsx)(n.h2,{id:"w3-total-cache",children:"W3 Total Cache"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://wordpress.org/plugins/w3-total-cache/",children:"W3 Total Cache"})," \u662F WordPress \u4E0A\u6700\u53D7\u6B22\u8FCE\u7684\u7F13\u5B58\u548C\u4F18\u5316\u63D2\u4EF6\u4E4B\u4E00\uFF0C\u6211\u4EEC\u9996\u5148\u9009\u62E9\u5B83\u8FDB\u884C\u5B89\u88C5\u3002\u5B89\u88C5\u5B8C\u6BD5\u540E\u70B9\u51FB\u201C\u542F\u7528\u201D\uFF0C\u6839\u636E\u5B83\u7684\u521D\u59CB\u5316\u5F15\u5BFC\u4E00\u6B65\u4E00\u6B65\u8FDB\u884C\u8BBE\u7F6E\u3002\u4E0B\u9762\u5217\u51FA\u5176\u4E2D\u4E3B\u8981\u7684\u51E0\u9879\u3002"]}),"\n",(0,i.jsx)(n.h3,{id:"page-cache",children:"Page Cache"}),"\n",(0,i.jsx)(n.p,{children:"\u8FD9\u4E00\u9879\u5C31\u662F\u5C06\u52A8\u6001\u9875\u9762\u9759\u6001\u5316\uFF0C\u4ECE\u800C\u51CF\u5C11\u6570\u636E\u5E93\u8BBF\u95EE\u3002"}),"\n",(0,i.jsx)(n.p,{children:"\u6839\u636E\u521D\u59CB\u5316\u5F15\u5BFC\u7684\u63A8\u8350\u62
111\u9009\u62E9\u5F00\u542F\u4E86 Disk: Enhanced \u6A21\u5F0F\u3002"}),"\n",(0,i.jsx)(n.h3,{id:"minify",children:"Minify"}),"\n",(0,i.jsx)(n.p,{children:"\u6700\u5C0F\u5316 CSS \u548C JS \u6587\u4EF6\u3002\u53EF\u80FD\u4F1A\u4EA7\u751F\u9875\u9762\u52A0\u8F7D\u95EE\u9898\uFF0C\u9700\u8981\u81EA\u884C\u6D4B\u8BD5\u540E\u9009\u62E9\u662F\u5426\u5F00\u542F\u3002"}),"\n",(0,i.jsx)(n.h3,{id:"opcode-cache",children:"Opcode Cache"}),"\n",(0,i.jsx)(n.p,{children:"WordPress \u662F\u7528 PHP \u7F16\u5199\u7684\uFF0C\u8FD9\u4E2A\u529F\u80FD\u662F\u7F13\u5B58\u7F16\u8BD1\u540E\u7684 PHP \u4EE3\u7801\uFF0C\u51CF\u5C11\u91CD\u590D\u7F16\u8BD1\u7684\u65F6\u95F4\u3002\u6B64\u529F\u80FD\u9700\u8981\u4ED8\u8D39\u5347\u7EA7\u5230 Pro \u7248\uFF0C\u6682\u672A\u5F00\u542F\u3002"}),"\n",(0,i.jsx)(n.h3,{id:"database-cache",children:"Database Cache"}),"\n",(0,i.jsx)(n.p,{children:"\u7F13\u5B58\u6570\u636E\u5E93\u67E5\u8BE2\u7684\u7ED3\u679C\u3002\u67D0\u4E9B\u60C5\u51B5\u4E0B\u53EF\u80FD\u67E5\u8BE2\u7F13\u5B58\u7684\u7ED3\u679C\u8FD8\u6CA1\u6709\u67E5\u8BE2\u6570\u636E\u5E93\u5FEB\uFF0C\u4E0D\u5EFA\u8BAE\u5F00\u542F\u3002"}),"\n",(0,i.jsx)(n.h3,{id:"object-cache",children:"Object Cache"}),"\n",(0,i.jsx)(n.p,{children:"\u7C7B\u4F3C Database Cache \uFF0C\u5EFA\u8BAE\u914D\u5408 Redis/memcached \u4F7F\u7528\u3002\u6682\u672A\u5F00\u542F\u3002"}),"\n",(0,i.jsx)(n.h3,{id:"browser-cache",children:"Browser Cache"}),"\n",(0,i.jsxs)(n.p,{children:["\u6D4F\u89C8\u5668\u7F13\u5B58\uFF0C\u5305\u62EC ",(0,i.jsx)(n.code,{children:"Cache-Control"}),", ",(0,i.jsx)(n.code,{children:"ETag"}),", ",(0,i.jsx)(n.code,{children:"Last-Modified"}),", ",(0,i.jsx)(n.code,{children:"Expires"})," \u7B49 HTTP \u7F13\u5B58\u63A7\u5236 headers \uFF0C\u53EF\u4EE5\u8FDB\u884C\u7CBE\u7EC6\u5316\u8BBE\u7F6E\u3002"]}),"\n",(0,i.jsx)(n.h3,{id:"cdn",children:"CDN"}),"\n",(0,i.jsxs)(n.p,{children:["\u9759\u6001\u8D44\u6E90\u6587\u4EF6\u53EF\u4F7F\u7528 CDN\u3002\u7531\u4E8E\u672C\u7AD9\u91C7\u7528 ",(0,i.jsx)(n.a,{href:"https://www.cloudflare.com/",children:"Cloudflare"})," \u4EE3\u7406\u52A0\u901F\uFF0C\u6545\u6682\u4E0D\u5F00\u542F\u3002"]}),"\n",(0,i.jsx)(n.h3,{id:"reverse-proxy",children:"Reverse Proxy"}),"\n",(0,i.jsxs)(n.p,{children:["\u53EF\u914D\u5408 ",(0,i.jsx)(n.a,{href:"https://varnish-cache.org/",children:"Varnish"})," \u4F7F\u7528\u3002\u6682\u672A\u5F00\u542F\u3002"]}),"\n",(0,i.jsx)(n.h3,{id:"user-experience",children:"User Experience"}),"\n",(0,i.jsx)(n.p,{children:"\u53EF\u9009\u62E9 \u56FE\u7247\u61D2\u52A0\u8F7D\u3001\u7981\u7528 Emoji \u7B49\u9009\u9879\u3002"}),"\n",(0,i.jsx)(n.h2,{id:"nginx-\u914D\u7F6E",children:"Nginx \u914D\u7F6E"}),"\n",(0,i.jsxs)(n.p,{children:["\u4EE5\u4E0A\u7684 W3 Total Cache \u5404\u9879\u8BBE\u7F6E\u5B8C\u6210\u5E76\u4FDD\u5B58\u540E\uFF0C\u4F1A\u5728\u4F60\u7684\u7F51\u7AD9\u6839\u76EE\u5F55\uFF08\u6B64\u76EE\u5F55\u53EF\u5728 WordPress \u7BA1\u7406\u540E\u53F0 \u2013 Performance \u2013 General Settings \u2013 Miscellaneous \u2013 Nginx server configuration file path \u66F4\u6539\uFF09\u4E0B\u751F\u6210\u4E00\u4E2A nginx.conf \u914D\u7F6E\u6587\u4EF6\uFF0C\u5728\u4F60\u7684\u7F51\u7AD9\u7684 ",(0,i.jsx)(n.a,{href:"https://github.com/W3EDGE/w3-total-cache/wiki/FAQ:-Installation:-Nginx-Web-Server",children:"nginx \u914D\u7F6E"}),"\u4E2D ",(0,i.jsx)(n.code,{children:"include"})," \u6B64\u6587\u4EF6\u5373\u53EF\u3002"]}),"\n",(0,i.jsx)(n.h3,{id:"\u4F8B\u5B50",children:"\u4F8B\u5B50"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-conf",children:"server {\n    listen       80;\n    server_name  yoursite.com;\n    access_log  /var/log/nginx/yoursite.com_access.log;\n    error_log  /var/log/nginx/yoursite.com_error.log debug;\n\n    root   /var/www/vhosts/yoursite.com;\n    index  index.php;\n\n    include /var/www/vhosts/yoursite.com/nginx.conf;\n\n    location / {\n        try_files $uri $uri/ /index.php?$args;\n    }\n\n    location ~ .php$ {\n        fastcgi_index index.php;\n        fastcgi_pass 127.0.0.1:9000;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        include fastcgi_params;\n    }\n}\n"})}),"\n",(0,i.jsx)(n.admonition,{type:"tip",children:(0,i.jsxs)(n.p,{children:["\u6BCF\u6B21\u66F4\u6539\u914D\u7F6E\u540E\uFF0C\u90FD\u8981\u91CD\u8F7D nginx \u914D\u7F6E (",(0,i.jsx)(n.code,{children:"nginx -s reload"}),") \u6216\u8005\u91CD\u542F nginx \u670D\u52A1 (",(0,i.jsx)(n.code,{children:"service nginx restart"}),") \u3002"]})})]})}function h(e={}){let{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}},28453(e,n,s){s.d(n,{R:()=>c,x:()=>a});var r=s(96540);let i={},o=r.createContext(i);function c(e){let n=r.useContext(o);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),r.createElement(o.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.