Skip to content

Conversation

eymar
Copy link
Member

@eymar eymar commented Aug 7, 2025

Use Web Cache API for string resources

Fixes https://youtrack.jetbrains.com/issue/CMP-7996

Testing

This should be tested by QA

Release Notes

Fixes - Resources

  • Use Web Cache API for string resources to avoid repeated and redundant HTTP requests

@eymar eymar requested a review from terrakok August 7, 2025 13:03
@eymar eymar changed the title Ok/use web caches for string resources response Use Web Cache API for string resources caching Aug 7, 2025
@eymar
Copy link
Member Author

eymar commented Aug 7, 2025

cc: @terrakok when you are back :)

I'd like to include this into 1.10

Copy link
Member

@terrakok terrakok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of the new ResourceReader's method I'd like to have next:

  • CvrWebCache - implementation of the web cache specifically for CVR files
  • in the web ResourceReader.readPart function implementation to add a logic: if the path is ended with .cvr then to use cached values

WDYT?

import org.w3c.workers.Cache

/**
* We use [Cache] and [org.w3c.dom.WindowSessionStorage] APIs to cache the successful strings.cvr responses.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use it specifically for Strings.CVR then let's rename it to StringsWebCache. Otherwise, we mustn't mention cvr in the kdoc

@terrakok
Copy link
Member

Might be worth to use it for all resource types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants