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

Video thumbnails are not cached #456

Closed
TheFrenchGhosty opened this issue Mar 27, 2019 · 11 comments
Closed

Video thumbnails are not cached #456

TheFrenchGhosty opened this issue Mar 27, 2019 · 11 comments
Labels
bug Something isn't working

Comments

@TheFrenchGhosty
Copy link
Member

TheFrenchGhosty commented Mar 27, 2019

Right now, invidious doesn't cache the videos thumbnails in the browser, this is not ideal in term of loading time (client) / data usage (client/server) / load (server).

https://i.imgur.com/gHTQwNe.gif

@omarroth omarroth added the bug Something isn't working label Mar 28, 2019
@ghost
Copy link

ghost commented Mar 30, 2019

@omarroth also css, fonts and favicons should be cached.

@Perflyst
Copy link
Contributor

CSS takes around 130-170ms
Images take up to 4s

This font https://invidio.us/fonts/ionicons.woff2?v=4.4.1 takes around 1s to load

@ghost
Copy link

ghost commented Mar 31, 2019

It's not about you, many have slow internet connection and limited bandwidth. Also caching images, css, fonts & favicon would save lots of bandwidth both for end user and the server. Currently my feed is about 700KB gzipped and without images it is <20KB, see the difference?

@omarroth
Copy link
Contributor

omarroth commented Apr 1, 2019

As mentioned in the Matrix server, Invidious includes headers from YouTube that should make the client cache thumbnails:
image

They unfortunately appear not to be working as expected, which is why this is labeled as a bug.

Static resources hosted on Invidious are already cached, see here.

@ghost
Copy link

ghost commented Apr 2, 2019

is something wrong with this report then? -> https://gtmetrix.com/reports/invidio.us/Xaf7Ix4a

@omarroth
Copy link
Contributor

omarroth commented Apr 2, 2019

The report appears correct. Invidious does not cache as aggressively for various reasons that results in it being scored quite poorly by that site, which recommends static assets by cached for a minimum of 1 month.

Is there anything from the report that I missed?

@ghost
Copy link

ghost commented Apr 2, 2019

It says that css, fonts and favicon is cached for 1 day and those images for 5 minutes. I think that 5 minutes time should be longer and for favicon and fonts it should be infinite. I can't say about css, is that altered often?

@Perflyst
Copy link
Contributor

Perflyst commented Apr 3, 2019

@cyaniventer as far as I can see in this report, the images are cached for 5 minutes?

@ghost
Copy link

ghost commented Apr 3, 2019

@Perflyst

gtmetrix report for invidio.us

See below it has information about favicons, css and fonts too.

@omarroth
Copy link
Contributor

Added partial fix for images with 62a4c82. Headers for caching weren't being correctly processed.

@omarroth
Copy link
Contributor

JS, CSS, favicons, and fonts are now cached for 1 month with a ?v= to provide new versions.

As mentioned above, thumbnail caching should now be handled as expected. Video thumbnails support additional headers (ETag, If-None-Match, etc.) that provide better caching than 5-minutes and isn't reflected in the above report.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants