0%

Optimize Hexo With Lazy Loading

Lazy loading is a design pattern commonly used in computer programming to defer initialization of an object until the point at which it is needed. It can contribute to efficiency in the program’s operation if properly and appropriately used.

Using lazy loading is easy:

  1. Install lazyload

    1
    npm install hexo-lazyload-image --save
  2. Update your _config.yml file as follows:

    1
    2
    3
    4
    lazyload:
    enable: true
    onlypost: false
    loadingImg: #/images/loading.png

Options are very intuitive.


Thanks to Troy!