How to Specify a character set early for webfonts

Hi community,

Recently I tested my site on GTmetrix and I found a recommendation for [Specify a character set early] for [vafpress-framework/public/css/webfonts/fa-brands-400.woff2].

Can anyone tell me how to i optimize my site for this?

Regards,
Abhishek Gupta

Which hosting are you using and what is the site URL?

I am using DO managed server on CW. Give me your email for link!!
Also, I am getting x-cache: MISS in the response headers.

Both problems are related to Hosting. Please contact its support.

Ok, I will talk to support. I have another question. I am facing HIGH first-byte time on using Cloudflare. I want to know that it is important to use Cloudflare for cache if I am using Breeze plugin.

Yes, please talk to them. If they are not able to provide solution, do let me know. I will provide solution regarding Character set and x-cache: MISS issue.

You can make TTFB 10 times faster using this guide.

Recently got a message from support!!

Thanks for the update. Yes those are the messages not errors. Actually, Breeze cache plugin does not use Memcached and APCu. It works perfectly fine without these. If you want to use Memcached then you need to switch to W3 Total Cache plugin.

So what I do, Switch to w3 total cache or remain with Breeze? What actually happens with x-cache: MISS issue?

I am not using W3 total cache so the guide is not for me.

That problem is related to Varnish cache. That MISS message indication are clear that Varnish is not working as expected. Your host probably don’t know how to deal with it :frowning:

Fixing that issue will require extensive debugging, can you provide .htaccess code?

Second, make sure that you have Breeze setup properly as written here

Ok, then you can use Cloudflare as DNS only mode. That should also fix the slowness issue.

How to set cloudflare as DNS only mode, it work like whole CDN and For firewall

  1. Login to Cloudflare
  2. Select your domain
  3. Go to DNS menu
  4. Keep Grey cloud for all records instead Orange.

Now, traffic will directly pass to origin, and it will be faster in your specific case.

# BEGIN iThemes Security - Do not modify or remove this line

# iThemes Security Config Details: 2

  # Disable XML-RPC - Security > Settings > WordPress Tweaks > XML-RPC

  <files xmlrpc.php>

  	<IfModule mod_authz_core.c>

  		Require all denied

  	</IfModule>

  	<IfModule !mod_authz_core.c>

  		Order allow,deny

  		Deny from all

  	</IfModule>

  </files>

# END iThemes Security - Do not modify or remove this line

## EXPIRES CACHING ##

<IfModule mod_expires.c>

# Enable expirations

ExpiresActive On 

# My favicon

ExpiresByType image/x-icon "access plus 1 year"

# Images

ExpiresByType image/gif "access plus 1 month"

ExpiresByType image/png "access plus 1 month"

ExpiresByType image/jpg "access plus 1 month"

ExpiresByType image/jpeg "access plus 1 month"

# CSS

ExpiresByType text/css "access plus 1 month"

# Javascript

ExpiresByType application/javascript "access plus 1 year"

# webfont

ExpiresByType font/ttf "access plus 1 year"

ExpiresByType font/woff2 "access plus 1 year"

</IfModule>

## EXPIRES CACHING ##

FileETag none

<filesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">

Header set Cache-Control "max-age=604800, public"

</filesMatch>

<IfModule mod_headers.c>

<FilesMatch ".(js|css|xml|gz|html)$">

Header append Vary: Accept-Encoding

</FilesMatch>

</IfModule>

<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts

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-javascript

AddOutputFilterByType DEFLATE application/xhtml+xml

AddOutputFilterByType DEFLATE application/xml

AddOutputFilterByType DEFLATE font/opentype

AddOutputFilterByType DEFLATE font/otf

AddOutputFilterByType DEFLATE font/ttf

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

Header append Vary User-Agent
</IfModule>

<Files 403.shtml>

order allow,deny

allow from all
</Files>

# BEGIN WordPress

<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


# WordPress SEO - XML Sitemap Rewrite Fix

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^sitemap_index.xml$ /index.php?sitemap=1 [L]

RewriteRule ^([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]

</IfModule>

# END WordPress SEO - XML Sitemap Rewrite Fix

# HSTS support 

<IfModule mod_headers.c>

Header set Strict-Transport-Security "max-age=31536000" env=HTTPS

</IfModule>

# End HSTS support

# Protect Wp-config

<files wp-config.php>

order allow,deny

deny from all

</files>

#End Protect Wp-config

Will it protect from Firewall bad attacks?

No, it won’t protect from bad attack like DDoS. However, Cloudflare DNS is still secure than most. It offers DNSSEC protection.

What Is DNSSEC?

Like many internet protocols, the DNS system was not designed with security in mind and contains several design limitations. These limitations, combined with advances in technology, have made it easy for attackers to hijack a DNS lookup for malicious purposes, such as sending a user to a fraudulent website that can distribute malware or collect personal information. The DNS Security Extensions (DNSSEC) is a security protocol created to mitigate this problem. DNSSEC protects against attacks by digitally signing data to help ensure its validity. In order to ensure a secure lookup, the signing must happen at every level in the DNS lookup process.

For DDoS or Brute force protection, you should prefer Sucuri Web Firewall services.

Or, opt for Cloudflare Pro/Business plan.

I checked that .htaccess code, everything seems normal.

How to fix x-cache: MISS problem?

The x-cache: MISS indicates that Varnish failed to cache the web page.

  1. Try to change Cache plugin to WP Rocket or W3TC

  2. disable/enable Varnish from Server menu

  3. Also, Check its custom configuration that is available at Applications menu. Make sure it’s not bypassing cache for any wrong reason.
    image

Still not resolved? Share website URL. I will check and update.

To fix this problem, you need to add below code in the top of .htaccess file.

AddType application/x-font-woff2 .woff2

Generally, this is job of Cache plugin to add proper mime type (describing File Format for certain extention) for all files. Or, at least it should be pre-configured at Server end. But, it’s Cloudways… so not to expect much. :expressionless:

Site:earningkart.in
Check the url.

After disabling orange cloud from CF, now i am facing high waiting issue.
Please check it.

But after switching to WP Rocket or W3TC, can I use breeze cache plugin? or I need to disable it?

Only one cache plugin should be used at one time. I would recommend WP Rocket.