Skip to content

Improve Caching Schema #50

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

Merged
merged 18 commits into from
Jan 20, 2022
Merged

Conversation

Archmonger
Copy link
Contributor

@Archmonger Archmonger commented Jan 12, 2022

@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
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
Copy link
Contributor Author

Archmonger commented Jan 13, 2022

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.

@rmorshea
Copy link
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
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
Copy link
Contributor Author

Archmonger commented Jan 14, 2022

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
Copy link
Contributor

rmorshea commented Jan 14, 2022

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
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
Copy link
Contributor

rmorshea commented Jan 14, 2022

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.

@rmorshea
Copy link
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
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
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