×

网站上线检查清单

Falcon 2022-11-18 views:
自动摘要

正在生成中……

逛Github时看到的,一位印度老哥的repo,我觉得挺好,应该作为网站开发者常识的存在。


HTML

html

  •  Minified HTML: medium The HTML code is minified, comments, white spaces and new lines are removed from production files.

  •  Remove unnecessary comments: low Ensure that comments are removed from your pages.

  •  Remove unnecessary attributes: low Type attributes like type="text/javascript" or type="text/css" are not required anymore and should be removed.

    <!-- Before HTML5 -->
    <script type="text/javascript">
        // JavaScript code
    </script>
    
    <!-- Today -->
    <script>
        // JavaScript code
    </script>
  •  Favicon present: high Does Favicon load? Pin the tab in Safari to check pinned icon

  •  Meta Title / Description Available: high Check page titles / descriptions
  •  Social Tags Present: high Test Facebook sharing. Provide og-tags if needed

⬆ back to top

CSS

css

  •  Minification: high All CSS files are minified, comments, white spaces and new lines are removed from production files.

  •  Concatenation: medium CSS files are concatenated in a single file (Not always valid for HTTP/2).

    <!-- Not recommended -->
    <link rel="stylesheet" href="foo.css"/>
    <link rel="stylesheet" href="bar.css"/>
    
    <!-- Recommended -->
    <link rel="stylesheet" href="foobar.css"/>
  •  Non-blocking: high CSS files need to be non-blocking to prevent the DOM from taking time to load.

    <link rel="preload" href="global.min.css" as="style" onload="this.rel='stylesheet'">
    <noscript><link rel="stylesheet" href="global.min.css"></noscript>

    ⁃ You need to add the rel attribute with the preload value and add as="style" on the <link> element.

  •  Unused CSS: medium Remove unused CSS selectors.

⬆ back to top

Fonts

fonts

⬆ back to top

JavaScript

javascript

  •  JS Minification: high All JavaScript files are minified, comments, white spaces and new lines are removed from production files (still valid if using HTTP/2).

  •  No JavaScript inside: medium (Only valid for website) Avoid having multiple JavaScript codes embedded in the middle of your body. Regroup your JavaScript code inside external files or eventually in the <head> or at the end of your page (before </body>).

    Ensure that all your files are loaded using async or defer and decide wisely the code that you will need to inject in your <head>.

  •  Non-blocking JavaScript: high JavaScript files are loaded asynchronously using async or deferred using defer attribute.

    <!-- Defer Attribute -->
    <script defer src="foo.js"></script>
    
    <!-- Async Attribute -->
    <script async src="foo.js"></script>

    ⁃ Add async (if the script don't rely on other scripts) or defer (if the script relies upon or relied upon by an async script) as an attribute to your script tag.
    ⁃ If you have small scripts, maybe use inline script place above async scripts.

  •  Check dependencies size limit: low Ensure to use wisely external libraries, most of the time, you can use a lighter library for a same functionality.

  •  JavaScript Profiling: medium Check for performance problems in your JavaScript files (and CSS too).

  •  Use of Service Workers: medium You are using Service Workers in your PWA to cache data or execute possible heavy tasks without impacting the user experience of your application.

⬆ back to top

Server

server-side

  •  Your website is using HTTPS: high

  •  Page weight < 1500 KB (ideally < 500 KB): high Reduce the size of your page + resources as much as you can.

  •  Page load times < 3 seconds: high Reduce as much as possible your page load times to quickly deliver your content to your users.

    Use online tools like Page Speed Insight or WebPageTest to analyze what could be slowing you down and use the Front-End Performance Checklist to improve your load times.

  •  Time To First Byte < 1.3 seconds: high Reduce as much as you can the time your browser waits before receiving data.

  •  Minimizing HTTP requests: high Always ensure that every file requested are essential for your website or application.

  •  Use a CDN to deliver your assets: medium Use a CDN to deliver faster your content over the world.

  •  Set HTTP cache headers properly: high Set HTTP headers to avoid expensive number of roundtrips between your browser and the server.

  •  GZIP / Brotli compression is enabled: high Use a compression method such as Gzip or Brotli to reduce the size of your JavaScript files. With a smaller sizes file, users will be able to download the asset faster, resulting in improved performance.

⬆ back to top

SEO & Services

meta

  •  Content Security: low Content Security Policy 101
  •  Robots.txt: high Verify robots.txt is present and allow's all robots
  •  Sitemap: high ensure that a sitemap is present and if the content is dynamic, proper functionality is there to auto update it
  •  Analytics: high Verify Tag Manager / Analytics have been correctly set up

Cloudflare

  •  high Set CloudFlare and do that necessary configurations
    •  SSL/TLS:
      •  Your SSL/TLS encryption mode => Flexible
    •  SSL/TLS -> Edge Certificates:
      •  Always use HTTPS => YES
      •  Automatic HTTPS Rewrites => YES
    •  Firewall -> Settings:
      •  Security Level => Essentially Off

Google Search Console

  •  low Submit all www/non-www http/https variations
  •  low Set up one non-www/www https as the preferred domain
  •  low Crawl > Fetch as Google > Submit to index to kickstart index

Bing Webmaster Tools

Backups

  •  Server: medium Are Server backups enabled?
  •  Database: medium Are Amazon S3 backups enabled for database?

Github

Twitter

  •  Finally, let the world know...
  •  
本文收录于