Is there any benefit in using <link rel="preload"> or <link rel="preconnect"> for resources on the same domain as the original page? - optimization

I've been reading up on performance benefits of using and to help fetch critical resources but one thing I can't quite figure out is whether these techniques still offer benefit when the resource is located on the same domain as the page that's requesting them.
E.g. I'm optimizing a page at abc.com Should I add a <link rel="preconnect" href="abc.com"> or <link rel="preload" as="script" href="abc.com/main.js"> to my markup? Or will it not have any effect since the current page is on the same domain as the link href values?

preconnect will have no effect (you are already connected to the domain).
preload will have an effect (causing resource to be fetched immediately, without waiting to discover where in the page is it used).

Related

How to add hreflang tags in SAP Spartacus

We have multiple basestores with multiple languages and want to implement the hreflang tags to all pages (if easier, it might not include cart and checkout) telling the searchengines that there are multiple versions of the same page in different languages.
We followed the guide on Automatic Context Configuration to provide the multiple basestores.
We also added the SiteContextSelectorComponent to allow the user to change the language.
At the moment all pages face the same structure:
https://company.com/us/en/c/CategoryName -> where us is the country and en the language
Other examples:
https://company.com/us/es/c/CategoryName -> us store with spanish language
https://company.com/us/de/c/CategoryName -> us store with german language
https://company.com/de/de/c/CategoryName -> de german store with german language
The hreflang tags should be generated like
<link rel="alternate" hreflang="en-us" href="https://company.com/us/en/c/CategoryName" />
<link rel="alternate" hreflang="es-us" href="https://company.com/us/es/c/CategoryName" />
<link rel="alternate" hreflang="de-us" href="https://company.com/us/de/c/CategoryName" />
<link rel="alternate" hreflang="de-de" href="https://company.com/de/en/c/CategoryName" />
<link rel="alternate" hreflang="x-default" href="https://company.com/c/CategoryName" />
Working with meta resolvers might not work, due to the fact, that the tags are link and not meta.
So what's the spartcus way to do this?
A (angular) solution might be, injecting the document and adding the tags this way. But is this really the preferred way?
And a further question would be, where's the right place to add these tags (on languageswitch? or routechange?)
Kind regards and thanks for your help,
Andreas
At the moment of writing, Spartacus doesn't have a mechanism for declaring in the <head> of the document the language-oriented alternate URLs.
However, Spartacus already implements the mechanism for resolving the canonical URL. It's based on the concept of multiple PageMetaResolvers and the core PageMetaService. Then the SeoMetaService observes the resolved meta-data for the current page and updates the document with appropriate canonical URL link, title, and other data.
You will need to write a customization for "alternate" links. And here are my recommendations how to do it:
extend the SeoMetaService and perhaps PageMetaLinkService - for phisically placing the links in the head of the document
perhaps extend the PageMetaConfig and PageMetaService for resolving specific values for your alternate links
The concrete strategy of resolving the "alternate" links might vary from customer to customer. Your case seems to be simple, since you don't have any localisation of the URL segments (e.g. /category/xxx in English vs. /categoría/xxx in Spanish). Your URLs seem to only vary in the URL prefix - the standard URL site context. Then you can derive your specific "alternate" links from the canonical URL (which Spartacus already have implemented) and replace only the language in the prefix of the URL path, e.g. using a RegExp.
Since you don't need a different strategy of resolving "alternate" links for different pages (e.g. different strategy for PDP and different for PLP), then you might "hardcode" your way of resolving "alternate" links either in your customized PageMetaService or SeoMetaService. In other words, you won't need to bother with customizing each and every existing PageMetaResolver.

Website Deep Products links not indexing In Google

I am working on one website, I have set all the required this for seo and looks all things are fine.
►But from long time, I have seen that deep product links are not going to index in Google as well some of the catagory pages.
Here is the site https://www.tradohub.com
What should I do for Google to index my web site? if someone can help.
Thanks
You have a canonical tag issue with your internal pages.
Let's take this page as an example...
https://www.tradohub.com/product-detail/raw-cashew-nuts
Reading the source code you have a canonical of...
<link rel="canonical" href="https://www.tradohub.com/" />
This tells search engines the page is a copy of the home page URL so will most likely not get indexed.
The canonical should be...
<link rel="canonical" href="https://www.tradohub.com/product-detail/raw-cashew-nuts" />
The canonical tags are the issue here so best fix them up.
Here's Google's info on the subject. https://support.google.com/webmasters/answer/139066?hl=en
Hope this helps.
William

Remove or change cloudflare script at top of page

I am using cloudflare and it is enhancing my website performance, but rocketscript is adding script at the top of page and I think
it is hurting my SEO
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <script type="text/javascript">
//<![CDATA[
try{if (!window.CloudFlare) {var CloudFlare=[{verbose:0,p:1417339881,byc:0,owlid:"cf",bag2:1,mirage2:0,oracle:0,paths:{cloudflare:"/cdn-cgi/nexp/dok2v=1613a3a185/"},atok:"d1860f61ecdb8c5c3826b01316cc8742",petok:"1fe291a32e5813fc73d592d28d6e79cdc75592ce-1417361255-1800",zone:"altibbi.com",rocket:"a",apps:{}}];document.write('<script type="text/javascript" src="//ajax.cloudflare.com/cdn-cgi/nexp/dok2v=919620257c/cloudflare.min.js"><'+'\/script>');}}catch(e){};
//]]></script>
<script type="text/rocketscript">(window.NREUM||(NREUM={})).loader_config={xpid:"VQQPU1NSGwcDVVhRAAY="};window.NREUM||(NREUM={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o?o:e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_requ........
How to remove it ? And why it is adding it ?
This message is for the people jumping this old thread to get rid of CDATA code from the site.
Just go inside the Page Rules.
Create a rule for your site : http://< mysite >/*
Then add the following :
Disable Apps
Smart Errors Off
Rocket Loader Off
Under free account you can create 3 pages rules. Pretty much enough for doing stuffs.
The Rocket Loader script wouldn't really impact SEO at all. Why do you believe it is? You can always turn that feature off in your performance settings.

How Next and Previous link buttons affect on Crawler

I am new to SEO, I had done a research and read several guids, but I am still confused.
A google guid said
Avoid creating complex webs of navigation links, e.g. linking every
page on your site to every other page.
I have an e-commerce website. We intend to create a page for each issue of a magazine. issue pages will have Next and Previous link buttons which will move from one issue to another.
Is that a bad idea, Am I violating this rule? or Google is talking about another scenario?
Is that will cause indexing all the 1000 issues? Given that the links are dynamic and I will use URL rewriting.
Thanks
This won't be a problem with Google. They clearly explain why it is a good thing to do and how to do it properly.
If you want to fully control your linkjuice transmition and the landing page from Google with a little website, using this method is not recommanded.
But, if it's for website with more than 1k of unique pages (you can't fully control and influence the webcrawler comportment) you can use this to ease the crawler indexing work and the landing page for users.
Pagination can be a fairly complicated aspect of SEO, especially for ecommerce sites.
Here are a few general tips:
If you have a "view all" page, you probably should rel="canonical" all your paginated pages to that page. This is acceptable because the content is identical
If you don't have a "view all" page, but you want Google to treat the first page as the "canonical" or you want to drive all users to the first page, then use the rel=next/prev attributes to "group" together your like pages
For ecommerce faceted navigation, you should probably use a combination of rel=next/prev and query parameter controls through Google Webmaster Tools
In the June 2012 SMX Advanced conference, there were a few good presentations and live blogging posts that highlights a number of these aspects. More notably, Googler Maile Ohye spoke during that conference ... she's sort of the Queen of Pagination ;)
http://www.slideshare.net/audette/seo-for-pagination-faceted-navigation-canonicalization-hits-and-misses
http://outspokenmedia.com/internet-marketing-conferences/pagination-canonicalization-for-the-pros-smx-advanced-2012/
http://www.bruceclay.com/blog/2012/06/pagination-canonicalization-for-the-pros-smx-advanced/
You might also want to watch this Google video with Maile talking about Pagination http://googlewebmastercentral.blogspot.com/2012/03/video-about-pagination-with-relnext-and.html
Last thing to note ... Bing doesn't support rel=next/prev at this time: http://searchengineland.com/no-bing-doesnt-support-pagination-attributes-to-consolidate-pages-in-a-series-118694
If I understand you correctly YES Google is talking about another scenario.
The Next and Previous links on the issue pages, used for navigation from one issue to another are different from <link rel="next" ... > and <link rel="previous" ... > which appear in the <head> ... </head> section of html source.
Google will treat webpages with <link rel="next" ... > and or <link rel="previous" ... > as a series of pages.

SEO of Pagination using rel="next" rel="prev" HTTP Headers

I am trying to perform some SEO on a pagination control I have on a website.
Following the Google guidelines, I would like to add link rel=next/prev i.e. <link href="/search/results?page=2" rel="next" /> to the <head> of my search results page.
Unfortunatley, due to a design decision / limitation of MVC3 with rendering sections and defining their content within Partials, I'm unable to do this.
So my question is - can I replicate the aforementioned functionality by adding a "Link" HTTP header, i.e. Link: <http://www.example.com/search/results?page=2>; rel="next" to the response and therefore not have to add the <link> tags in the <head>?
This was answered by Maile Ohye.
#estrik: We support rel=”next” and rel=”prev” in the HTTP header. For example, for page=2 of an article, you could respond with the HTTP header:
Link: http://www.example.com/article?story=abc&page=1; rel="prev"
Link: http://www.example.com/article?story=abc&page=3; rel="next"
Referring to this post from a Google employee rel=prev/next in the HTTP header is supported by Google
At the moment, I'm pretty sure they aren't supporting that, as they aren't support having the rel attribute on the anchor either.