Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ghost 3.0 下,搜索页面性能优化 #28

Open
halfrost opened this issue Jul 24, 2020 · 0 comments
Open

Ghost 3.0 下,搜索页面性能优化 #28

halfrost opened this issue Jul 24, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@halfrost
Copy link
Owner

halfrost commented Jul 24, 2020

  1. 图片全部懒加载
    麻烦点在于,合适判断图片展示出来。在当前 js 中,加上了 lazyload 也没有加载出这些图片,因为搜索页面 pop 出来的时候没有触发 lazyLoad 函数。可以考虑在 img 标签里面加入 data-loaded="true" 这个属性辅助判断是否需要加载了。

  2. 图片适度加载,利用裁剪 api,裁到合适大小

  3. recent post 会额外请求一次,可以考虑省去这次请求,因为第一次加载博客首页的时候,最近的 5 篇文章的数据已经都可以拿到了,不需要再次请求了。

@halfrost halfrost changed the title Ghost 3.0 Ghost 3.0 下,搜索页面性能优化 Jul 24, 2020
@halfrost halfrost added the enhancement New feature or request label Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant