Use of java for serialization does not directly replace ehcache
nsiemens opened this issue · 6 comments
You are using Java to do the object serialization. This turns into a gotcha because the default play2 cache doesn't, and therefore is able to serialize classes that don't implement Serializable. Which causes fireworks when your plugin replaces the default and everything that caches a non-implementer of Serializable breaks because of the additional requirement that your plugin is placing on input to the Cache.
Thanks for the info!
I think I have missed about that until now.
Would you mind providing me where I can see Ehcache's object serialization algorithm?
This is an issue if you want to cache the play.mvc.Result instances. The default Ehcache can do so while play2-memcached cannot.
Thanks for your feedback, @nsiemens @mwy001 !
I'll write specs for play.mvc.Result chaching and tackle it with twitter's chill.
Further feedbacks and pull requests are always welcome!
Scala Pickling looks promising but for now it doen't allow serializing/deserializing Any or AnyRefs.
@mumoshu maybe instead of looking for silver bullet which will cover all cases, it will be better to give some basic serializer and allow users to plug-in they own serializers, like the akka's serialization do?
This way we will give control (and responsibility) over performance, backward compability, fields ommiting etc. to the end user.
If you want to cache a Result
just use SerializableResult
:
https://github.com/playframework/playframework/blob/2.6.1/framework/src/play-cache/src/main/scala/play/api/cache/Cached.scala#L189