• Resolved ducsd

    (@ducsd)


    Hello there!
    Need help with missing static headers settings.
    When I click on static files headers in the plugin menu, all I can see is the green checkmark wich says that it’s acticvated. NO settings, NO switch. I guess it should be there, because when I check the site by gmetrix or manually check the browser cache I see cached files. Now the fun thing. My .htaccess file is empty (NO ## EXPIRES HEADER CACHING ## rules in it), but files are cached anyway (of course after emptying the cache). If I disable the whole plugin the caching stops. I tried to reinstall the plugin, also checked that I have no other caching plugin installed, emptying local (server) and browser cache – it’s the same. I thought maybe there is another “hidden” .htaccess file, but didn’t find any. Also, I don’t use CDN. Why I can’t see any settings for it?

    • This topic was modified 2 years, 11 months ago by ducsd. Reason: Typo
Viewing 5 replies - 1 through 5 (of 5 total)
  • @ducsd Could you please add following rules to your htaccess file and then check the score on GTMtrix?

    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" 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
    	RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    	RewriteBase /
    	RewriteRule ^index\.php$ - [L]
    	RewriteCond %{REQUEST_FILENAME} !-f
    	RewriteCond %{REQUEST_FILENAME} !-d
    	RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    # BEGIN WP-Optimize Gzip compression
    <IfModule mod_filter.c>
    	<IfModule mod_deflate.c>
    # Compress HTML, CSS, JavaScript, Text, XML and fonts
    		AddType application/vnd.ms-fontobject .eot
    		AddType font/ttf .ttf
    		AddType font/otf .otf
    		AddType font/x-woff .woff
    		AddType image/svg+xml .svg
    		
    		AddOutputFilterByType DEFLATE application/javascript
    		AddOutputFilterByType DEFLATE application/rss+xml
    		AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
    		AddOutputFilterByType DEFLATE application/x-font
    		AddOutputFilterByType DEFLATE application/x-font-opentype
    		AddOutputFilterByType DEFLATE application/x-font-otf
    		AddOutputFilterByType DEFLATE application/x-font-truetype
    		AddOutputFilterByType DEFLATE application/x-font-ttf
    		AddOutputFilterByType DEFLATE application/x-font-woff
    		AddOutputFilterByType DEFLATE application/x-javascript
    		AddOutputFilterByType DEFLATE application/xhtml+xml
    		AddOutputFilterByType DEFLATE application/xml
    		AddOutputFilterByType DEFLATE font/opentype
    		AddOutputFilterByType DEFLATE font/otf
    		AddOutputFilterByType DEFLATE font/ttf
    		AddOutputFilterByType DEFLATE font/woff
    		AddOutputFilterByType DEFLATE image/svg+xml
    		AddOutputFilterByType DEFLATE image/x-icon
    		AddOutputFilterByType DEFLATE text/css
    		AddOutputFilterByType DEFLATE text/html
    		AddOutputFilterByType DEFLATE text/javascript
    		AddOutputFilterByType DEFLATE text/plain
    		AddOutputFilterByType DEFLATE text/xml
    		
    # Remove browser bugs (only needed for really old browsers)
    		BrowserMatch ^Mozilla/4 gzip-only-text/html
    		BrowserMatch ^Mozilla/4\.0[678] no-gzip
    		BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    		<IfModule mod_headers.c>
    			Header append Vary User-Agent
    		</IfModule>
    	</IfModule>
    </IfModule>
    # END WP-Optimize Gzip compression
    # BEGIN WP-Optimize Browser Cache
    <IfModule mod_expires.c>
    	ExpiresActive On
    	ExpiresByType text/css "access 28 days"
    	ExpiresByType text/html "access 28 days"
    	ExpiresByType image/gif "access 28 days"
    	ExpiresByType image/png "access 28 days"
    	ExpiresByType image/jpg "access 28 days"
    	ExpiresByType image/jpeg "access 28 days"
    	ExpiresByType image/webp "access 28 days"
    	ExpiresByType image/x-icon "access 28 days"
    	ExpiresByType application/pdf "access 28 days"
    	ExpiresByType application/javascript "access 28 days"
    	ExpiresByType text/x-javascript "access 28 days"
    	ExpiresByType application/x-shockwave-flash "access 28 days"
    	ExpiresDefault "access 28 days"
    </IfModule>
    
    <IfModule mod_headers.c>
    	<filesMatch "\.(ico|jpe?g|png|gif|webp|swf)$">
    		Header set Cache-Control "public"
    	</filesMatch>
    	<filesMatch "\.(css)$">
    		Header set Cache-Control "public"
    	</filesMatch>
    	<filesMatch "\.(js)$">
    		Header set Cache-Control "private"
    	</filesMatch>
    	<filesMatch "\.(x?html?|php)$">
    		Header set Cache-Control "private, must-revalidate"
    	</filesMatch>
    </IfModule>
    
    #Disable ETag
    FileETag None
    # END WP-Optimize Browser Cache
    Thread Starter ducsd

    (@ducsd)

    Thank you! Now I see date/time settings! Should I see anything else, cause I don’t know how this page looks by default? If there is just date/time I guess it’s solved then. Logically I also should see the enable/disable button, shouldn’t I?

    • This reply was modified 2 years, 11 months ago by ducsd.
    • This reply was modified 2 years, 11 months ago by ducsd.

    @ducsd There is no enable/disable button, it should look like this: https://prnt.sc/22k9m8e

    Thread Starter ducsd

    (@ducsd)

    Ok, thank you for the screenshot. That’s helpful.

    @ducsd You’re welcome ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Static file headers missing’ is closed to new replies.