Skip to content

Improve Caching Schema#50

Merged
Archmonger merged 18 commits into
reactive-python:mainfrom
Archmonger:fix-caching
Jan 20, 2022
Merged

Improve Caching Schema#50
Archmonger merged 18 commits into
reactive-python:mainfrom
Archmonger:fix-caching

Conversation

@Archmonger

@Archmonger Archmonger commented Jan 12, 2022

Copy link
Copy Markdown
Contributor

@Archmonger Archmonger marked this pull request as ready for review January 12, 2022 12:19
@Archmonger Archmonger requested a review from a team as a code owner January 12, 2022 12:19
@Archmonger

Copy link
Copy Markdown
Contributor Author

This now uses aiofile as well, which means fetching IDOM web modules is fully async.

Should be performant enough to where we can put off #4 for a while.

@Archmonger

Archmonger commented Jan 13, 2022

Copy link
Copy Markdown
Contributor Author

I had a concept to use cache versioning to help invalidate old web module files stored in cache.

But, unfortunately this doesn't work since the temp directory names are randomized, thus we have no easily cross-platform replicable cache key.

Comment thread src/django_idom/config.py Outdated
@rmorshea

Copy link
Copy Markdown
Contributor

temp directory names are randomized

By default IDOM_WEB_MODULES_DIR is a temp dir, but that can be changed. For example you could set it using appdirs. That way it would be static.

@rmorshea

Copy link
Copy Markdown
Contributor

A note on changing IDOM_WEB_MODULES_DIR: since there may already be files there at the time you change the directory you should copy over any existing files into the new location.

@Archmonger

Archmonger commented Jan 14, 2022

Copy link
Copy Markdown
Contributor Author

Is the default behavior within Core to not override existing files, even if they have different contents?

If not, then I think I should hold off on implementing anything related to cache invalidation until that takes place.

@rmorshea

rmorshea commented Jan 14, 2022

Copy link
Copy Markdown
Contributor

The default behavior does not overwrite. The code there is a little messy though so I just put up a PR to clean that up: reactive-python/reactpy#586

@Archmonger

Copy link
Copy Markdown
Contributor Author

Alright. I'll handle app directory stuff when reactive-python/reactpy#586 is closed and made into a PyPI release.

In that case this PR is ready for merge. You need to make Python 3.7 tests non-required on your end for that to happen though.

@Archmonger Archmonger changed the title Clean up caching schema Improve Caching Schema Jan 14, 2022
@rmorshea

rmorshea commented Jan 14, 2022

Copy link
Copy Markdown
Contributor

IDOM core can continue supporting 3.7, you'll just need to constrain the supported versions in setup.py for this package. I'll make a note of that since I missed it earlier.

Comment thread .github/workflows/test.yml
@rmorshea

Copy link
Copy Markdown
Contributor

@Archmonger the latest version of IDOM has been released with the changes from reactive-python/reactpy#586. Is there anything else to do here?

@Archmonger

Copy link
Copy Markdown
Contributor Author

This PR should be feature complete, can't be merged without making 3.7 not required. I'm assuming that's in the project settings?

I'll make a separate PR to bump IDOM in here to the new version.

@rmorshea

Copy link
Copy Markdown
Contributor

Feel free to merge

@Archmonger Archmonger merged commit eef3c9d into reactive-python:main Jan 20, 2022
@Archmonger Archmonger deleted the fix-caching branch February 1, 2022 03:27
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.

Rename cache backend to "idom"

2 participants