[google-appengine] Memcaching BlobProperty
Hi, I just installed appstats and noticed that I'm hitting the database for images all the time instead of the cache. In my image server I pull the image data from the blobstore to serve and use memcache to store the blob data for later use. Using logging, I've determined that it is setting the memcache with the image data, but the next time I go to grab this image memcache returns None. My theories are: 1. Memcache doesn't like BlobProperty values 2. My image data is > 1MB (however I've wrapped my memcache in a try/ catch block so I would have thought it would be throwing errors if this was the case...) Any idea on why memcache seems to be failing? Thanks :) -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
RE: [google-appengine] Memcaching BlobProperty
I serve images at about 1 meg all the time. I don't put things larger than 1 meg in memcache, cause mem-cache isn't that big, and Blobstore is darn fast. -Original Message- From: google-appengine@googlegroups.com [mailto:google-appengine@googlegroups.com] On Behalf Of Melissa Hong Sent: Thursday, November 03, 2011 9:33 PM To: Google App Engine Subject: [google-appengine] Memcaching BlobProperty Hi, I just installed appstats and noticed that I'm hitting the database for images all the time instead of the cache. In my image server I pull the image data from the blobstore to serve and use memcache to store the blob data for later use. Using logging, I've determined that it is setting the memcache with the image data, but the next time I go to grab this image memcache returns None. My theories are: 1. Memcache doesn't like BlobProperty values 2. My image data is > 1MB (however I've wrapped my memcache in a try/ catch block so I would have thought it would be throwing errors if this was the case...) Any idea on why memcache seems to be failing? Thanks :) -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en. -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
Re: [google-appengine] Memcaching BlobProperty
Hi Melissa, It's likely your data is simply being evicted as not worth the memory it takes up - you can fit a lot of smaller memcache values in the space a blob takes up. Consider just setting the correct caching headers in your response, instead. This will result in frontends, proxies and browsers caching your content, without using up precious memcache space. -Nick Johnson On Fri, Nov 4, 2011 at 3:32 PM, Melissa Hong wrote: > Hi, > > I just installed appstats and noticed that I'm hitting the database > for images all the time instead of the cache. > > In my image server I pull the image data from the blobstore to serve > and use memcache to store the blob data for later use. > > Using logging, I've determined that it is setting the memcache with > the image data, but the next time I go to grab this image memcache > returns None. > > My theories are: > 1. Memcache doesn't like BlobProperty values > 2. My image data is > 1MB (however I've wrapped my memcache in a try/ > catch block so I would have thought it would be throwing errors if > this was the case...) > > Any idea on why memcache seems to be failing? > > Thanks :) > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to google-appengine@googlegroups.com. > To unsubscribe from this group, send email to > google-appengine+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- Nick Johnson, Developer Programs Engineer, App Engine -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.