Comments (8)
Interesting idea,
This would also allow files to be shared or inspected just like any other file using Finder or Preview, etc.
If nobody objects, this could be a good idea for a PR. Interested, @sgl0v?
from sptpersistentcache.
@iOSCowboy , I'll start working on this if there are not objections. I would be nice to have a backward compatible solution I guess.
from sptpersistentcache.
Let's ping the gang and see what are their thoughts about it. Summoning @spotify/objc-dev!
Regarding backward compatibility: the life of the files in the cache is short lived, might be enough just to flush the cache at the beginning (just brainstorming, but I think the solution is something fairly simple).
Thanks for your interest, Max!
from sptpersistentcache.
As far as backwards compatibility goes, we could have a "cache protocol version" that factors into the cache key. We bump that version whenever serialization changes in a breakable way and forces the cache keys to be different. And/or we store the serialization version for the cache ID in NSUserDefaults
(or something like that) and if the version ever changes, we invalidate the entire cache. A solid migration strategy is something we should figure out otherwise we're locked in.
from sptpersistentcache.
We originally didn't do this because we were considering making the cache in C with a small Objective-C wrapper on top, making a major use case to support POSIX systems. Having said that, thats not the way it panned out, and so I think it's perfectly acceptable to add extended file attributes to the cache for the metadata. Backwards compatibility unfortunately will be required, we have some offlined files using the persist mode, and it would be a shame if we nuked them for our users
from sptpersistentcache.
@8W9aG: Many filesystems support extended file attributes (wiki). Would probably be more trouble than it's worth to cleanly support all of them, but it is possible to make a cross-platform core provided the FS supports extended file attributes.
from sptpersistentcache.
Thanks for the input, team.
Looks like this would be an awesome PR, @sgl0v!
from sptpersistentcache.
Thanks for clarification, guys. Will start working on this improvement then.
from sptpersistentcache.
Related Issues (20)
- How to get URI of cached images?
- Doesn't compile under Xcode 10 HOT 2
- Framework Fails to Build HOT 1
- "Messaging unqualified id" error in Xcode 11b1 HOT 5
- Deployment target triggers a compiler warning in Xcode 12+
- Format README for v1.0 HOT 1
- Improve example app
- Logo text looks weird for those, who is familiar with cyrillic alphabet HOT 1
- Change the default cache path HOT 2
- Static or dynamic lib doesnt work properly. HOT 3
- Can't access cache by sync methods HOT 1
- Framework is missing CFBundleVersion value HOT 2
- Need a new version? HOT 3
- Cache fails to store large files HOT 1
- Wrong nullability flags on SPTPersistentCacheResponse HOT 4
- Retrieved UIImage has wrong size dimensions HOT 1
- Scheduling of garbage collection
- Initializing cache results in EXC_BAD_INSTRUCTION HOT 1
- Need help about caching HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sptpersistentcache.