pache缓存
ExpiresActiveOnExpiresByTypeimage/jpg"accessplus1month"ExpiresByTypeimage/png"accessplus1month"ExpiresByTypetext/css"accessplus1week"ExpiresByTypeapplication/pdf"accessplus1month"ExpiresByTypetext/javascript"accessplus1week"ExpiresByTypeapplication/x-javascript"accessplus1week"
pache配置
ServerAdminadmin@example.comDocumentRoot/path/to/webroot/ServerNameyourdomain.comErrorLog${APACHE_LOG_DIR}/error.logCustomLog${APACHE_LOG_DIR}/access.logcombinedOptionsIndexesFollowSymLinksAllowOverrideAllRequireallgranted
在PHP配置文件php.ini中启用OPcache:zend_extension=opcache.soopcache.enable=1opcache.memory_consumption=128opcache.interned_strings_buffer=8opcache.max_accelerated_files=4000opcache.revalidate_freq=60opcache.fast_shutdown=1
缓存设置
缓存可以大大提升网站的加载速度。在久久午夜综合网站中,你可以通过以下步骤启用缓存:
Apache缓存:可以使用Mod-Cache模块来启用Apache缓存。安装后,在Apache配置文件中添加以下配置:CacheQuickHandleronCacheLockonCacheLockPath/var/cache/apache2/mod_cache_lockCacheIgnoreHeadersSet-CookieCacheIgnoreNoLastModOnCacheDefaultExpire600CacheMaxExpire2419200CacheMinExpire60PHP缓存:可以使用OPcache来缓存PHP代码。
使用Let’sEncrypt免费SSL证书
sudoapt-getinstallcertbotpython3-certbot-apachesudocertbot--apache-dyourdomain.com
安装完成后,系统将自动配置SSL证书并设置自动续费提醒。
校对:周轶君(f3J1ePQDlzHhwh44q38w4Ima2E3XrDq)


