apache / apisix-website

Apache APISIX Website
https://apisix.apache.org/
Apache License 2.0
127 stars 174 forks source link

[Site]: improve static files performance #1203

Open juzhiyuan opened 2 years ago

juzhiyuan commented 2 years ago

Current State

Resources Sample

  1. https://apisix-website-static.apiseven.com/zh/assets/js/runtime~main.26c4290b.js
  2. https://apisix-website-static.apiseven.com/assets/js/runtime~main.e301679c.js

TODO

  1. return"assets/js/" → with CDN
  2. return"assets/css/ → with CDN

Other

  1. https://askubuntu.com/questions/513046/how-to-search-strings-inside-files-like-in-windows-without-search-monkey

Desired State

Description of the change you are proposing:

See Current State

Would you like to fix this issue?

No response

SkyeYoung commented 2 years ago

I think we need to consider code-splitting first 🤔

SkyeYoung commented 2 years ago

I'm also trying to remove gsap, but in order to keep the original animation as much as possible, I may need to introduce other dependencies, so the exact bundle size needs to be analyzed further.

1502shivam-singh commented 1 year ago

Umm, I am pretty sure removing gsap isn't the only culprit that might speed up the website drastically, meaning the profit and loss is heavily unbalanced, less profit, more loss.

I would almost prefer to say that if converting the animation's timing and spacing to what was originally the case is problematic, we are hurting the website, and making it look amateurish (you know, font sizes, animations, hierarchy etc. being off) .

This is really important brand wise

I mean to say, if we really don't want to use gsap, than either use framer or something, as the animations I see of today are very off and uneven in easing and timing. So, forcing to recreate the same animations in css, if seems problematic then why force yourself, it's not leading to any major gain anyways (performance wise, as was the thought goal I suppose)

Plus we are losing some key interactions like the snap fix and show on scroll features in the middle section, which are like some things that stay in minds of users and make them return.

All I am trying to say is we are losing on brand front here if this doesn't get fixed 😬

Also, why are we changing things like this stepwise, and that too on the live website ? I mean such drastic changes so quickly might confuse the user on whether the website is even working properly. Maybe @SkyeYoung you should work out everything separately first than push after review, just a suggestion.

Sorry, for the long rant but this is something I really wanted to say.

SkyeYoung commented 1 year ago

@1502shivam-singh I don't have the ability to make everything better in one commit, but our SEO, performance needs are obviously more pressing, so I choose to tweak the site as soon as possible rather than wait until all the issues are resolved before submitting changes.

On matters such as removing GSAP and animations, you can see through my PR submission that my attention has clearly not been on those areas lately.

I've recently been trying to cut up the original site to achieve some capabilities that were previously unattainable, and you can see those changes at #1225 #1218.

Anyway, things will always get better, so let's stay patient together.

1502shivam-singh commented 1 year ago

@1502shivam-singh I don't have the ability to make everything better in one commit,

What I meant was distributing similar type of changes in a single PR. If it seems unfeasible no worries, use your own work style.

On matters such as removing GSAP and animations, you can see through my PR submission that my attention has clearly not been on those areas lately.

Sure I get this, but let me rephrase what i said, my main concern is having difficulty in imitating exactly the animations with same spacing and timing. GSAP is just a medium through which I am trying to communicate that you can either use Framer or something more lightweight for your needs, if CSS animations seem painful for the task.

I've recently been trying to cut up the original site to achieve some capabilities that were previously unattainable, and you can see those changes at #1225 #1218.

Really commend your work on this, few weeks back I was also thinking of something like this. Great work !

Anyway, things will always get better, so let's stay patient together.

Sure, I am just trying to highlight the negative points here so you are aware of an overall design perspective, so i may seem impatient (Especially from the rant above 😅), but don't let it interfere with your work, okay.