keepthatworktoyourself / wombat

Not another website builder. Public repo — raise issues, request features, get help.
2 stars 0 forks source link

Site creation performance #315

Closed bhallstein closed 9 months ago

bhallstein commented 11 months ago

This is a "thought that just occurred to me" issue: creating an initial site currently can take quite a few seconds (minimum is about 10s). This is mostly limited by the API duplicating a bunch of media files (which are stored on S3). On various platforms I've used site creation is generally slow. On Wombat it should be super fast.

Possible optimisations:

  1. Pre-duplicate all template sites N times, so there are N sites just laying around to be "claimed" by the user in the background when they create a site. (This would make site creation basically instantaneous.)
    • Only complexity here would come from having to A. do this in the background and B. remove and re-add these sites whenever a template site is updated.
  2. Duplicate a site in two phases:
    • Instantly duplicate the homepage, navs, etc.
    • In a daemon that runs in the background, gradually populate the site with posts, then media
    • This would make the new site appear more or less instantly, and then "gradually" (over the next e.g. 5s-300s for small to large sites) populate with posts and media items
  3. (✅ as of https://github.com/keepthatworktoyourself/wombat/issues/340) The API currently downloads media files from S3 then uses the upload endpoint to re-upload them (also resizing them all from the original, which takes the bulk of the time). Instead it should just use the S3 API to duplicate the files without needing to either download/upload them or resize them.
    • This is probably the lowest hanging fruit in terms of performance optimisation.
bhallstein commented 9 months ago

Closing as resolved in https://github.com/keepthatworktoyourself/wombat/issues/340 and performance is now 'good enough'. Ideas above can be implemented if needed in future.