• Resolved gregstoltz

    (@gregstoltz)


    Hi, I am currently getting a 1/100 score on “Add Expires Headers” on YSlow and I cant figure out why I continue to get the error, hoping that someone could take a look through my .htaccess and let me know

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter gregstoltz

    (@gregstoltz)

    # BEGIN WordPress
    # The directives (lines) between <code>BEGIN WordPress</code> and <code>END WordPress</code> are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    # BEGIN cPanel-generated php ini directives, do not edit
    # Manual editing of this file may result in unexpected behavior.
    # To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
    # For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
    <IfModule php7_module>
    php_flag display_errors Off
    php_value max_execution_time 60
    php_value max_input_time 90
    php_value max_input_vars 2000
    php_value memory_limit 128M
    php_value post_max_size 250M
    php_value session.gc_maxlifetime 1440
    php_value session.save_path "/var/cpanel/php/sessions/ea-php73"
    php_value upload_max_filesize 256M
    php_flag zlib.output_compression Off
    </IfModule>
    <IfModule lsapi_module>
    php_flag display_errors Off
    php_value max_execution_time 60
    php_value max_input_time 90
    php_value max_input_vars 2000
    php_value memory_limit 128M
    php_value post_max_size 250M
    php_value session.gc_maxlifetime 1440
    php_value session.save_path "/var/cpanel/php/sessions/ea-php73"
    php_value upload_max_filesize 256M
    php_flag zlib.output_compression Off
    </IfModule>
    # END cPanel-generated php ini directives, do not edit
    
    # BEGIN ShortPixelWebp
    # The directives (lines) between <code>BEGIN ShortPixelWebp</code> and <code>END ShortPixelWebp</code> are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    # END ShortPixelWebp
    # php -- BEGIN cPanel-generated handler, do not edit
    # Set the “ea-php73” package as the default “PHP” programming language.
    <IfModule mime_module>
    AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
    </IfModule>
    # php -- END cPanel-generated handler, do not edit
    
    <IfModule mod_expires.c>
      ExpiresActive On
    
      # Images
      ExpiresByType image/jpeg "access plus 1 year"
      ExpiresByType image/gif "access plus 1 year"
      ExpiresByType image/png "access plus 1 year"
      ExpiresByType image/webp "access plus 1 year"
      ExpiresByType image/svg+xml "access plus 1 year"
      ExpiresByType image/x-icon "access plus 1 year"
    
      # Video
      ExpiresByType video/mp4 "access plus 1 year"
      ExpiresByType video/mpeg "access plus 1 year"
    
      # CSS, JavaScript
      ExpiresByType text/css "access plus 1 month"
      ExpiresByType text/javascript "access plus 1 month"
      ExpiresByType application/javascript "access plus 1 month"
    
      # Others
      ExpiresByType application/pdf "access plus 1 month"
      ExpiresByType application/x-shockwave-flash "access plus 1 month"
    </IfModule>

    public_html/wp-content/cache/autoptimize/.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
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    looks correct, this means that either you’re not on Apache or Apache has been configured not to allow certain overrides or Apache is running without mod_expires .. you’ll have to check with your hoster.

    for the autoptimized resources you could try to disable the “serve as static files” option?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Closing as “resolved” for Autoptimized resources, feel free to follow up here though.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘GTMetrix Add Expires Header’ is closed to new replies.