As an experienced website operations expert, I have a deep understanding of the powerful functions of AnQiCMS (AnQiCMS) and its excellent performance in content operations.Today, let's talk about an important and often misunderstood topic: the loading order of Json-LD in AnQiCMS templates, and whether it will affect the page rendering speed.

The elegant loading journey of Json-LD in AnQiCMS template

Firstly, let us clarify the positioning of Json-LD.It is a lightweight data format based on JSON, used to embed structured data in web pages.This data is invisible to users, but it is a key clue for search engines to understand page content, provide rich search results (Rich Snippets), and even build knowledge graphs.AnQi CMS understands the importance of SEO and therefore incorporates structured data from the outset, striving to make your website more competitive in search engines.

In AnQiCMS, there are mainly two ways to load Json-LD: system default generation and template customization.

1. The幕后intelligent processing of the system default.

When you enable the structured data feature on the AnQiCMS backend (usually this is part of the SEO settings), the system will automatically generate the corresponding Json-LD structured data based on the content type of the current page (such as article detail page, product detail page, category list page, etc.). These data will be presented in one<script type="application/ld+json">The form of a tag, inserted into the HTML structure of a page.

According to the design philosophy and industry **practice of AnQiCMS, these default generated Json-LD scripts are usually placed in the HTML document's<head>area or following<body>After the tag. The benefits of doing this are obvious:

  • Friendly to search engines:When search engine crawlers crawl and parse pages, they will prioritize processing<head>Part of the content.Placing Json-LD here ensures that crawlers can discover and understand these structured data earlier, thereby increasing the likelihood of the page being correctly indexed and displaying rich search results.
  • Unified and automated:AnQiCMS through its flexible content model and tagging system (such asarchiveDetail/categoryDetail/pageDetailetc.), able to dynamically extract relevant information from the database and automatically fill in the Json-LD data fields.This greatly reduces the workload of manual maintenance, ensuring that structured data is synchronized with the page content update.

2. Flexible control of template customization

The AnQiCMS template engine (based on Go language's Pongo2, with syntax similar to Django templates) provides high flexibility. If you need to supplement, override, or even completely customize the default Json-LD of the system, AnQiCMS also prepares exclusive tags for you:{% jsonLd %}...{% endjsonLd %}.

This custom tag allows you to insert your own Json-LD code at any location in the template. For example, you can add or modify Json-LD in the template of the article detail page by using the following method:

{% jsonLd %}
<script type="application/ld+json">
{
	"author": "AnQiCMS运营团队",
	"image": [
		"{{ archive.Logo }}",
		"https://en.anqicms.com/anqicms-logo.png"
	],
	"articleSection": "网站运营技巧"
}
</script>
{% endjsonLd %}

In this case, the actual loading order of Json-LD depends on you will{% jsonLd %}The tag is placed in the position within the template. Of course, considering the above SEO-friendly considerations, we usually still recommend placing it in<head>or<body>Start nearby.AnQiCMS handles this custom tag by intelligently merging the data you define with the system-generated default data, ensuring that the final Json-LD output meets your personalized needs while maintaining integrity.

Does the loading order of Json-LD affect the page rendering speed?

This is a common concern for many website operators, especially in today's pursuit of extreme page loading speed. My answer for Json-LD is: It has almost no effect on the visible rendering speed of the page.

Let's analyze the reasons in depth:

  • The advantages of server-side rendering (SSR):AnQiCMS is developed based on the Go language, which means it uses a high-performance server-side rendering architecture.When a user requests a page, AnQiCMS will generate all the HTML content including Json-LD on the server side, and then send it all at once to the user's browser.In this process, Json-LD is just a small part of the HTML document, its generation is synchronous with the generation of the entire page HTML, and it will not increase the waiting time of the client.
  • Json-LD is data and not executable code:The Json-LD tag'stypeattribute isapplication/ld+jsonThis clearly tells the browser that it is a data block, not a JavaScript script to be executed immediately, nor CSS styles that will affect the page layout.The browser recognizes this block of data while parsing HTML, but it will not pause the construction of the DOM (Document Object Model) or the drawing of page content.It is considered metadata that does not block the rendering of the page.
  • The file size is negligible:Even though the Json-LD data contains rich information, the file size is usually very small, usually only a few KB to tens of KB.This is negligible compared to the images, CSS, and JavaScript files that may be loaded on the entire page.Such a small amount of additional data, the delay brought by network transmission and browser parsing can be ignored almost.

Conclusion:


Frequently Asked Questions (FAQ)

1. I should put the customized{% jsonLd %}where is the best position to place the tag in AnQiCMS template?Although Json-LD does not block page rendering, in order to allow search engine crawlers to find and process these structured data as soon as possible, the industry universally recommends placing it in the HTML document.<head>Within the area. If it cannot be placed due to some template structure restrictions<head>then follow<body>After the label is also a good choice. The key is to appear as early as possible so that the crawler can capture it before giving up parsing the page.

2. Will Anqicms automatically generate Json-LD for all pages? What if I don't want some pages to have it?AnQiCMS data structure generation is usually automatically matched according to page type and content.Whether it is generated for all pages and which types of data are generated by default require checking the backend SEO settings or structured data configuration options.If you do not want a page to include Json-LD, you can usually disable or override the default behavior in the page editing interface or through a custom template.{% jsonLd %}Label, and if the background does not enable the default structured data feature, then this page will not have Json-LD.

3. Can Json-LD replace traditional Meta tags (such as Keywords and Description)?Cannot be replaced; they are complementary relationships.Json-LD and Meta tags overlap in functionality, but have their respective focuses.Meta tags (especially the Description) mainly provide search engines with page summaries and keyword hints, although the Keywords tag now has a negligible impact on SEO.And Json-LD describes the specific entities on a page in a more structured and semantic way (such as articles, products, comments, events, etc.), helping search engines to deeply understand the properties and relationships of these entities.Combining both can provide the most comprehensive and clear page information for search engines, thereby maximizing your SEO effect.