Skip to content

Add a way to invalidate preview cache - #77697

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
KoBeWi:cachepocalypse
Apr 29, 2024
Merged

Add a way to invalidate preview cache#77697
akien-mga merged 1 commit into
godotengine:masterfrom
KoBeWi:cachepocalypse

Conversation

@KoBeWi

@KoBeWi KoBeWi commented May 31, 2023

Copy link
Copy Markdown
Member

The new tooltips for textures and audio streams rely on preview metadata. But for previews generated before the metadata was added it will be empty, so the tooltips will display 0x0 dimensions or 0 length. It will display as that until the resource is modified (i.e. its hash changes).

This PR adds a mechanism to force refreshing the previews, so that correct metadata is loaded. Preview cache gets a new field: version. To invalidate previews we just need to increase the current version. Note that it forces all exiting previews to be generated again, which is rather costly in terms of I/O in big projects. Also some previews seem to be generated only on demand, so their tooltips are invalid and print an error when displayed for the first time.

@KoBeWi KoBeWi added this to the 4.1 milestone May 31, 2023
@akien-mga akien-mga modified the milestones: 4.1, 4.2, 4.x Jun 13, 2023
@akien-mga akien-mga modified the milestones: 4.x, 4.3 Apr 26, 2024
@akien-mga
akien-mga merged commit 47d8654 into godotengine:master Apr 29, 2024
@akien-mga

Copy link
Copy Markdown
Member

Thanks!

@KoBeWi
KoBeWi deleted the cachepocalypse branch April 29, 2024 08:45
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
Add a way to invalidate preview cache
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
Add a way to invalidate preview cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants