Jandev / Jandev/minifier

Store & read in-memory cache on local disk

Open
#19 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
4
Forks
3
PR merge metrics
No merged PRs in 30d

Description

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

```json
{
"entries": [
{
"slug": "the-slug",
"fullUrl": "https://the-full-url/"
}
]
}
```
Additional properties can be added when necessary, like an `updatedOn`.

Contributor guide

Open the contributing guide

Research direction

Start by locating the Azure Function's in-memory cache and Cosmos DB access paths, then inspect how cache state is initialized and cleared. Persist and reload the entries in D:\home\data\cache.json using the shown schema, and verify that the cache survives a Function restart while retaining the expected URL mappings.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
backend, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.