• Resolved treecutter

    (@treecutter)


    Hello

    After activating Autoptimize, a file .htaccess is created in the cache folder.

    When using Nginx as the only webserver, the file will be ignored.

    Does this mean Autopimize will be broken, and/or not be as fast, and/or not be secure with Nginx ? and if so do you have a guide for the equivilent of below for Nginx

    Thanks very much

    contents of …./autopimize/cache/.htaccess

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css A30672000
    ExpiresByType text/javascript A30672000
    ExpiresByType application/javascript A30672000
    </IfModule>
    <IfModule mod_headers.c>
    Header append Cache-Control “public, immutable”
    </IfModule>
    <IfModule mod_deflate.c>
    <FilesMatch “\.(js|css)$”>
    SetOutputFilter DEFLATE
    </FilesMatch>
    </IfModule>
    <IfModule mod_authz_core.c>
    <Files *.php>
    Require all denied
    </Files>
    </IfModule>
    <IfModule !mod_authz_core.c>
    <Files *.php>
    Order deny,allow
    Deny from all
    </Files>
    </IfModule>
    ErrorDocument 404 /wp-content/autoptimize_404_handler.php`

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    * security: no issues
    * performance: you’ll have to ensure that compression (gzip/ deflate/ br) of CSS/ JS (and other files) are configured in nginx
    * for the 404 handler: either make sure 404’s are handled by WordPress OR use the code snippet example in the AO FAQ ??

    hope this clarifies,
    frank

    Thread Starter treecutter

    (@treecutter)

    Hello Frank

    As usual, top drawer support, thank you.

    Autopimize is just about the best supported WordPress plugin, it’s little wonder that Autopimize has been a massiver success !!

    Should have read the manual, of course ! Understand the 404 handler now.

    Have to admit, never used “immutable” for caching before…..

    Thanks again for the brilliant support, highly appreciated

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome treecutter ??

    Hello I see your Nginx example but I think not required. And, messy if we must put new rules for every WP plugins.

    Only this:

    location / {
    try_files $uri $uri/ /index.php?$args;
    ....

    is enough to make WordPress control the 404 error handling. And Autoptimize already hooked to handle template 404 I think.

    that is proper and clean way for logical handling. htaccess is very messy and Nginx has single (easy) config.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    ah, didn’t know that @yasuf21, thanks for your input!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Autoptimize and Nginx’ is closed to new replies.