Hi Green,
Just turned on memcached for the first time as the Play! Cache implementation and immediately have a problem. Looking at GreenScriptPlugin.bufferLocator_.newBuffer(List resourceNames, String extension) it adds the buffer to cache before the buffer has actually been populated - the buffer is then subsequently populated. This might be fine with a pure single JVM memory solution but with memcached or any other distributed cache I suspect it won't work as it ends up just adding empty values to the cache.
My first impression is that Cache.set(..) in GreenScriptPlugin.bufferLocator_.newBuffer(...) needs to be moved out a new method, such as storeBuffer(BufferResource), and called separately at the end of Minimizer.minimize(List resourceNames) so buffer is stored in the Cache only once it has been populated. I know probably a few more things to be changed to accomodate this but that's the general gist.
I'll try and have a deeper look into what could be changed later today but I wanted to give you a heads up. I need this fixed asap because I have other code depending on memcached being configured as the Play! cache.
cheers,
Chris
Hi Green,
Just turned on memcached for the first time as the Play! Cache implementation and immediately have a problem. Looking at GreenScriptPlugin.bufferLocator_.newBuffer(List resourceNames, String extension) it adds the buffer to cache before the buffer has actually been populated - the buffer is then subsequently populated. This might be fine with a pure single JVM memory solution but with memcached or any other distributed cache I suspect it won't work as it ends up just adding empty values to the cache.
My first impression is that Cache.set(..) in GreenScriptPlugin.bufferLocator_.newBuffer(...) needs to be moved out a new method, such as storeBuffer(BufferResource), and called separately at the end of Minimizer.minimize(List resourceNames) so buffer is stored in the Cache only once it has been populated. I know probably a few more things to be changed to accomodate this but that's the general gist.
I'll try and have a deeper look into what could be changed later today but I wanted to give you a heads up. I need this fixed asap because I have other code depending on memcached being configured as the Play! cache.
cheers,
Chris