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

Store & read in-memory cache on local disk #19

Open
Jandev opened this issue Apr 4, 2023 · 0 comments
Open

Store & read in-memory cache on local disk #19

Jandev opened this issue Apr 4, 2023 · 0 comments

Comments

@Jandev
Copy link
Owner

Jandev commented Apr 4, 2023

When a Function stops running, the in-memory cache will also be cleared.

For us to have the least amount of hits to Cosmos DB, the cache can be stored & read from the local disk.
As proofed in this repository: https://github.com/Jandev/poc-scale-infinite-shared-state the state should be stored in:

Sharing date has to be done in the D:\home\data\-folder.

The state can be stored as a human-readable JSON document, called cache.json.
The contents will look like

{
    "entries": [
        {
            "slug": "the-slug",
            "fullUrl": "https://the-full-url/"
        }
    ]
}

Additional properties can be added when necessary, like an updatedOn.

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

No branches or pull requests

1 participant