Skip to content

Optimize media loading across app#10592

Merged
rijkvanzanten merged 37 commits intomainfrom
v-image
Jul 20, 2022
Merged

Optimize media loading across app#10592
rijkvanzanten merged 37 commits intomainfrom
v-image

Conversation

@jamescammarano
Copy link
Copy Markdown
Contributor

@jamescammarano jamescammarano commented Dec 17, 2021

Fixes #11652, fixes #14513

Adds a new v-image wrapper component that augments the browser native <img> with some Directus magic, most notably:

  • It uses Authorization headers over access token query params for authentication
  • It lazy loads based on viewport visibility by default
  • It relies on the same queue as regular API requests, ensuring you don't run into the rate limiter on the cards layout with a large limit.

@rijkvanzanten rijkvanzanten changed the title Create v-image component to add images to the request queue. Optimize media loading across app Dec 27, 2021
@rijkvanzanten
Copy link
Copy Markdown
Member

I'm hijacking this PR to achieve the same thing for GIFs, audio, and video!

@rijkvanzanten rijkvanzanten removed this from the v9.4.1 milestone Dec 27, 2021
@rijkvanzanten rijkvanzanten added this to the v9-next milestone Dec 27, 2021
@rijkvanzanten rijkvanzanten marked this pull request as draft December 28, 2021 17:33
@rijkvanzanten
Copy link
Copy Markdown
Member

Lets use https://videojs.com for video / audio

@rijkvanzanten rijkvanzanten modified the milestones: v9.4.2, v9-next Dec 31, 2021
@rijkvanzanten rijkvanzanten added this to the Next Release milestone Jul 20, 2022
@rijkvanzanten rijkvanzanten merged commit 8204576 into main Jul 20, 2022
@rijkvanzanten rijkvanzanten deleted the v-image branch July 20, 2022 19:52
qborisb pushed a commit to qdentity/directus that referenced this pull request Jul 22, 2022
* v-image and "lazy load" working

* fixed vars

* all the other img uses

* No longer require access token in url for files

* Add lazy loading and size limits

* Rename map-component source prop

* Fix lint warning

* Update app/src/views/public/public-view.vue

Co-authored-by: ian <licitdev@gmail.com>

* Fix lint

* Fix missing file type icon

* Fix null imageInfo error

* Use video.js for media playback

* Fix .js file display

* Update package-lock.json

* Update package-lock.json

* update package.json

* Update pnpm-lock.yaml

* Remove unrelated addition on VDatePicker

* Remove folder abstraction

* Use image data based aspect ratio on preview

* Base app rate throttle on API rate limit config

* Configure app rate limit throttle based on api config

* Convert v-image to script[setup]

* Convert v-media to script[setup]

* Cleanup v-media

* Remove unneeded addTokenToUrl usages

* Remove video.js

It doesn't do authorization headers for mp4/mp3, so it's pointless

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
Co-authored-by: ian <licitdev@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

429 Too Many Requests error on Cloud App Insecure passing of access_token in URL parameters

3 participants