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

Comments

@TheFrenchGhosty
Copy link
Contributor

commented Mar 27, 2019

Right now, invidious don'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 label Mar 28, 2019
@ghost

This comment has been minimized.

Copy link

commented Mar 30, 2019

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

@Perflyst

This comment has been minimized.

Copy link
Contributor

commented Mar 30, 2019

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link

commented Apr 2, 2019

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

@omarroth

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

commented Apr 3, 2019

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

@ghost

This comment has been minimized.

Copy link

commented Apr 3, 2019

@Perflyst

gtmetrix report for invidio.us

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

@omarroth

This comment has been minimized.

Copy link
Owner

commented Apr 11, 2019

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

@omarroth

This comment has been minimized.

Copy link
Owner

commented May 10, 2019

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.

@omarroth omarroth closed this May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.