代码之家  ›  专栏  ›  技术社区  ›  brody

Apache ExpiresDefault A0不工作

  •  3
  • brody  · 技术社区  · 8 年前

    我添加了以下配置:

    # No caching for dynamic files
    <filesMatch "\.(php|cgi|pl|htm)$">
        ExpiresDefault A0
        Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
        Header set Pragma "no-cache"
    </filesMatch>
    

    但显示了以下错误:

    AH00526: Syntax error on line 86 of /etc/apache2/conf-enabled/headers.conf: Invalid command 'ExpiresDefault', perhaps misspelled or defined by a module not included in the server configuration Action '-t' failed.
    

    1 回复  |  直到 8 年前
        1
  •  5
  •   Barry Pollard    8 年前

    LoadModule expires_module modules/mod_expires.so
    

    或者,如果在基于Debian的系统上,则使用以下命令启用它:

    a2enmod expires