- This topic has 10 replies, 2 voices, and was last updated 4 years, 1 month ago by
Tom.
-
AuthorPosts
-
February 14, 2019 at 8:55 pm #810946
Tamhas
Hi! I would like to make the TTF and WOFF load from my CDN instead of from my server:
/wp-content/plugins/gp-premium/general/icons/gp-premium.ttf
/wp-content/themes/generatepress/fonts/generatepress.woff2They are on the CDN but page is not loading them from there for some reason.
How can make that happen please?
GeneratePress 2.2.2GP Premium 1.7.7February 15, 2019 at 9:15 am #811437Tom
Lead DeveloperLead DeveloperHi there,
I believe that would depend on your CDN. It should happen automatically.
Have you been in touch with your CDN support yet?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 15, 2019 at 6:01 pm #811681Tamhas
The CDN has pulled the files, they are on it ok. But the site is still telling browser to pull from original site url instead of cdn url. I am using cdn enable for the url re-writing, everything else is working fine but for the two mentioned files. How could I manually re-write those, please?
February 15, 2019 at 7:20 pm #811701Tom
Lead DeveloperLead DeveloperI’m not sure, unfortunately. Are you using a plugin to set the CDN up on your site?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 16, 2019 at 3:47 am #811851Tamhas
hi yes I am using KeyCDN’s “Cachd enabler”. It re-writes everything but not those two for some reason.
I know little about all this, but I was thinking since the files are in your theme, there must also bring a line or two of code in your theme tell the browser where to pull the files from. And that that could be changed manually. If I knew where is was. And I did have a look but no luck.
February 16, 2019 at 9:44 am #812190Tom
Lead DeveloperLead DeveloperThere isn’t really anything special about how the theme adds those files – they’re added using
@font-face
.It might be worth checking with the plugin developer whether there’s something we need to do manually in order to include them in the CDN.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 17, 2019 at 7:27 am #812819Tamhas
OK, asking them, thanks. Meant to say “cdn enabler”, not cache enabler BTW
February 17, 2019 at 7:32 am #812821Tamhas
Actually i had found font face before, and I thought maybe I could change the URLs for the fonts as below … but that didn’t work either. No idea, that’s just my best guess. I am using System Stack fonts BTW.
@font-face {
font-family: ‘GeneratePress’;
src: url(‘fonts/generatepress.eot’);
src: url(‘fonts/generatepress.eot#iefix’) format(’embedded-opentype’),
url(‘https://cdn.mysite.com/wp-content/themes/generatepress/fonts/generatepress.woff2’) format(‘woff2’),
url(‘https://cdn.mysite.com/wp-content/themes/generatepress/fonts/generatepress.woff’) format(‘woff’),
url(‘https://cdn.mysite.com/wp-content/themes/generatepress/fonts/generatepress.ttf’) format(‘truetype’),
url(‘fonts/generatepress.svg#GeneratePress’) format(‘svg’);
font-weight: normal;
font-style: normal;
}February 17, 2019 at 8:51 am #812878Tom
Lead DeveloperLead DeveloperDoesn’t look like you changed all of the URLs.
However, I would assume the CDN plugin should re-write those requests without you needing to manually change the files.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentFebruary 17, 2019 at 8:55 am #812885Tamhas
No only changed the woff2 and ttf so far, as that’s what I am seeing in gtmetrix. Just because that’s what their test is pulling.
If it works I would change them all. Might it work if I did that right now?
Yes their plugin re-wrote everything else fine. Just not these too. Don’t know why.
February 17, 2019 at 5:22 pm #813129Tom
Lead DeveloperLead DeveloperHmm, I’m not sure. Maybe you have some sort of caching going on preventing the change from showing right away? Manually changing the link like that should work in theory.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.