0

The caching portion of all of the speed tests fail on my site because I am using font files to pull in my fonts.

I am using w3 Total Cache, and KeyCDN.

The font files are hosted in a folder inside the themes folder. I have altered my .htaccess file to allow these fonts to come through the cdn and this seams to be working (the font file type in use by the browser uses the cdn while the file types not in use maintain the actual domain).

I have looked all over google for an idea on how to cache these files but I can't seam to find anything. I am a bit of a novice in this department though so i might not be asking the right questions.

Any ideas?

5
  • 1
    If you're using a CDN to serve your fonts, your work is already done. Not sure how this is specifically WordPress related? (it's very much an Apache/server admin/webmasters question) Commented May 12, 2016 at 9:44
  • That is what I thought. Only I am using firefox and all of the .woff files are failing to register as cached by all speed testers. The reason I feel this is a wordpress issue is that I am using wordpress, and wordpress plugins.
    – JSum
    Commented May 12, 2016 at 11:20
  • This might be what you're looking for: wordpress.org/support/topic/browser-caching-of-woff-files
    – cjbj
    Commented May 12, 2016 at 11:38
  • 1
    Whilst you might be using WordPress for this project, the problem has nothing to do with WordPress. A bit of googling suggests this is a known problem Commented May 12, 2016 at 11:40
  • My only form of caching is W3 Total Cache which is a Wordpress plugin. being the case, I am trying to find out how to get W3 Total Cache to cache my font files. This is a Wordpress problem.
    – JSum
    Commented May 13, 2016 at 4:49

1 Answer 1

1

In nearly all of the case WP doesn't participate in serving static files. Its rewrite rules are typically configured to ignore them and let web server handle.

Otherwise overhead of firing up PHP engine and WP core for each static request would be incredibly taxing.

As such there is no mechanism in WP to deal with caching issues for static files (outside of some concatenation of admin assets for core use only).

Not the answer you're looking for? Browse other questions tagged or ask your own question.