Laravel does the site need to be static page?

Source: Internet
Author: User
Tags http 200
Laravel inside the files are blade.php, need not convert to HTML, more conducive to the spider included?

Reply content:

Laravel inside the files are blade.php, need not convert to HTML, more conducive to the spider included?

Now the spider, even if it is the rotten force of Baidu, it is not likely to be foolish enough to see .html special preferential treatment.

And if the page is static, the spider itself cannot be inferred. So static or not has no effect on the inclusion.

You really need to ensure that the URL and HTML are persistent, do not let spiders produce "article in frequent update cheat included" such a miscalculation.

In particular, the means are complex, the following are a few references:

    • Permanent links should be planned from the very beginning, and do your best to stay the same unless you die.

    • If you change, make sure you have the old link 301 to the new link, and that the Guide search engine is labeled in. Absolutely no new or old links are HTTP 200.

    • Using HTML5 semantic tags, impartiality and text and auxiliary content (sidebar, advertising, navigation, etc.) area, guide the search engine to identify the body. For example:, ,

      , , and so on.

    • Click on the number, comments, ads, leaderboards and other volatile areas, consider using JS dynamic loading and other means to achieve, so as to ensure that the same article text unchanged, the HTML content output will not change.

Blade again lightweight also is dynamic rendering, compared to native PHP is not superior, not to mention and static ratio.

Static is the most thorough form of caching, and caching is most troublesome to rebuild. Therefore, consider the following principles:

    • The plan is a blind guess . Caching must be based on practical needs, how to optimize the absolute can not be utopian or blind.

    • Premature optimization is the source of all evil . Normal function is the first, do not want to cache without development.

    • no measurement, no optimization . Optimization must first be hit on the performance bottlenecks found in the test .

and the following specific reference opinions:

    • Cache to be progressive, do not directly push to the end.

    • Specifically, the built-in cache service is used to target the most frequently requested database points and only the data portion is cached. Page rendering remains blade unchanged.

    • If this is still not enough, consider full page content caching, but routing still uses the built-in route service.

    • At this time no longer consider static.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.