Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

https://fonts.googleapis.com/***

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 05-06-2017, 10:16 PM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default https://fonts.googleapis.com/***

The various versions of this link used within XC5, will always cause issues with leverage browser caching / static - mainly because, being provided by Google yep, there's no caching allowed. This has been briefly touched on before, but in a different forum query that was specifically related to the Google Analytics Module. This last item in this post (from that thread) is the most relevant : https://forum.x-cart.com/showpost.php?p=402988&postcount=7

It's actually specified within 6 different XC5 Core files (2 x php / 1 x twig / 3 x html) in our own, current XC5 based store, but we're pretty sure that NONE of these, other than the two shown below possibly, have any association with the module above. FWIW, If we run our Dev Store with that module disabled, this font is stalled called up. Your own store(s) may be different...
PHP Code:
.../classes/XLite/View/CommonResources.php
.../var/run/classes/XLite/View/CommonResourcesAbstract.php 
So our two questions are:

Are there any specific, technical reasons WHY this font still being used? e.g. No Google based module. like the already mentioned Google Analytics Module will work properly without the Core inclusion of this font... or something like this?

If so, has anybody actually, genuinely tried this at XC?

On a different domain / non-XC5 setup that we have, we removed all links to Google's "...you can't cache our precious content, otherwise we'll take our ball home..." and replaced them with alternative settings, with no detrimental effect, but it's not XC5, so this discovery may not be relevant here....

In most of the current XC 5 Core code, it's presented this way:
Code:
'url' => '//fonts.googleapis.com/css?family=' . urlencode('Open Sans:300italic,400italic,600italic,700italic,400,300,600,700') . '&subset=' . urlencode('latin,cyrillic,latin-ext'),

So to summarise, if there's NO absolute technical reason for still using it, could it be replaced with an alternative (cacheable) font with effect from XC 5.3.3.* onwards? Because XC5.* is getting better and better (XC 5.3.2.9 is like chalk and cheese compared to XC 5.1.* ) so it seems a big limiting factor, to be forever following Google's own, convenient 'rules'.
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote

The following user thanks Triple A Racing for this useful post:
kevinrm (05-07-2017)
  #2  
Old 05-09-2017, 11:44 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: https://fonts.googleapis.com/***

I believe it is not the case for Google Fonts, only Google Analytics is affected.

I've checked the online demo and it loads Google Fonts from the browser cache on subsequent views.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #3  
Old 05-10-2017, 12:07 AM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default Re: https://fonts.googleapis.com/***

Quote:
Originally Posted by qualiteam
I believe it is not the case for Google Fonts, only Google Analytics is affected.
I've checked the online demo and it loads Google Fonts from the browser cache on subsequent views.
With the arrangement of the wording, we're not totally sure what this answer means. Sorry! Did you mean:

a) The ONLY thing that DOES use those Google Fonts is the Google Analytics Module? Therefore removal of that specific Module will (or should...) also remove those fonts from the XC5 Core because they are not needed anywhere else?

or

b) Those fonts are actively used in several areas within XC5 and the Google Analytics Module is just one of them?

If it's a) then back to the question in the previous post:
Quote:
....No Google based module. like the already mentioned Google Analytics Module will work properly without the Core inclusion of this font... If so, has anybody actually, genuinely tried this at XC?
If it's b) then it's the same question really for all Google based modules supplied by XC (not any third party) as the coding is generated in-house. Yes they have to be to Google's "rules' but #FontFailure may not be an 'offence' that subsequently causes Module failure. As per our own previous example, but also accepting that it was NOT within XC, so it maybe different when it's tried by the XC Dev Team
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote
  #4  
Old 05-10-2017, 12:10 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: https://fonts.googleapis.com/***

I mean that the "Google don't cache their resources" issue applies to Google Analytics scripts only.
Google Fonts resources are cached by browsers.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #5  
Old 05-10-2017, 12:20 AM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default Re: https://fonts.googleapis.com/***

Just re-run prior to this post:

Quote:
Leverage browser caching of static assets: 87/100
FAILED - (No max-age or expires) - https://fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600 italic%2C700italic%2C400%...ext&1494115091
WARNING - (60.0 minutes) - https://www.google-analytics.com/plugins/ua/ec.js
WARNING - (2.0 hours) - https://www.google-analytics.com/analytics.js
Quote:
Originally Posted by qualiteam
I mean that the "Google don't cache their resources" issue applies to Google Analytics scripts only
Yes, that makes perfect sense - see above and there's some corrective actions on this module due in XC 5.3.3.* anyway we now understand. Thank you.
Quote:
Originally Posted by qualiteam
Google Fonts resources are cached by browsers.
Hmmm but here is the problem. They are NOT cached in the same way as anything else so all the previous questions still apply, aka WHY are the used? For what specific technical reasons? etc & What 'alternative' tests have been done, if everyone can see the sense in replacing them
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote
  #6  
Old 05-15-2017, 10:50 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: https://fonts.googleapis.com/***

I doubt there were any technical reasons to use Google Fonts. Designers use web fonts not because it is a technical requirement

As for caching: I don't get what the problem is. Google do cache their fonts in the way that allows them quickly fix problems with their CSS (if any happens).
Their FAQs state that font files are cached for a year. Yes, they send an HTTP header that makes their CSS files to expire in a day, but these files are so small that this should not noticeable affect the page loading time. Plus it will be loaded once a day only.

What problem do you want to fix by switching from Google Fonts to "alternatives"? What alternatives would you suggest?
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #7  
Old 05-15-2017, 11:56 PM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default Re: https://fonts.googleapis.com/***

Quote:
Originally Posted by qualiteam
I doubt there were any technical reasons to use Google Fonts. Designers use web fonts not because it is a technical requirement
Exactly. So why did they choose Google, when there are many alternatives available, all, without the "joys" of dealing with Google. That's the question in a more specific format really. See other posts on Google's "self-focus first" etc
Quote:
Originally Posted by qualiteam
...Google do cache their fonts in the way that allows them quickly fix problems with their CSS (if any happens)
The most relevant part here is "...that allows them..." That's the issue isn't it? i.e. Them not XC or any end-user or whoever else. See comment above ^
Quote:
Originally Posted by qualiteam
What problem do you want to fix by switching from Google Fonts to "alternatives"?
That's the question that the Dev Team / Designers should be asking themselves surely? This particular issue is well known and well recognised (examples have already been posted by us and others on here and in other forums etc) so from a pro-active perspective... the answer, to what appears to be a self-created problem lies with Dev Team / Designers. As end-users, we can only report factual issues with finished XC products. If we become deeply involved in XC core design or re-design, we've lost focus on our own business we think We only use Unix / Apple products and their third-party compatible products ourselves, but if there is an issue with any of these, it gets fixed. Quickly. Especially if it's a publicly acknowledged issue.
Quote:
Originally Posted by qualiteam
What alternatives would you suggest?
It does not matter at all what we suggest. It's 100% the designer's choice. If he/she/they did not see this issue in advance, okay everyone is human and it's a minor issue compared to others if we are being honest. However, many alternatives are readily available to them. If a designer opts for the "....ohhhhh....don't know which to choose..." approach. It would then becomes a bigger issue!

If it can be fixed. Fine. If it can't or it won't (because it's not sufficiently important enough currently) that's also fine. All actions are by the Dev Team though, not end-users who have identified the issue. Let's see what happens as we move into XC5.3.3.* etc
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote
  #8  
Old 05-16-2017, 02:36 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: https://fonts.googleapis.com/***

I'm sorry, but I don't see what problem you want to fix there by switching to a different font provider (besides you don't like Google).
Browsers cache Google's font files (for a year), and cache the "wrapping" CSS file for a day - this is pretty enough for fast site loading.
It may be a good idea to cache some static files forever, but in case of fonts supplied by any third-party provider it is good to have the fonts updated with newer versions released by the supplier.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #9  
Old 05-16-2017, 03:22 AM
 
Triple A Racing Triple A Racing is offline
 

X-Wizard
  
Join Date: Jul 2008
Location: Manchester UK
Posts: 1,028
 

Default Re: https://fonts.googleapis.com/***

Quote:
Originally Posted by qualiteam
I'm sorry, but I don't see what problem you want to fix there by switching to a different font provider
No problem. Let's agree to disagree We did say "it's a minor issue compared to others if we are being honest"
Quote:
Originally Posted by qualiteam
...besides you don't like Google
For various factual reasons to be fair. Those that do, simply don't know, what they don't know when it comes to Google
Quote:
Originally Posted by qualiteam
Browsers cache Google's font files (for a year), and cache the "wrapping" CSS file for a day - this is pretty enough for fast site loading. It may be a good idea to cache some static files forever, but in case of fonts supplied by any third-party provider it is good to have the fonts updated with newer versions released by the supplier
Yes to all of this. However, it's not caching per se. It's the 'leverage browser caching' that's the issue we're referring too. Have a look in Stack Overflow or Mobile First Design or anywhere similar. There's no 100% achievable / manageable solution IF Google Fonts are used. The real irony is that this will show as an issue on Google's own PageSpeed Tests and the relevant section within PageSpeed Tools. Meanwhile, if other fonts are chosen... well
__________________
Dev Store & Live Store XC Business 5.4.1.35
Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian
Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33
Reply With Quote
  #10  
Old 06-30-2017, 03:15 PM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: https://fonts.googleapis.com/***

You can self host them you know... https://google-webfonts-helper.herokuapp.com/fonts

Shameless plug, little experiment (in SEO mainly). Search for 'Google Fonts List' in Google
__________________
xcartmods.co.uk
Reply With Quote

The following user thanks PhilJ for this useful post:
Triple A Racing (06-30-2017)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:49 AM.

   

 
X-Cart forums © 2001-2020