Only pad entities larger then page size. Add min size for gzipping
Reorder conditions
Add hit counter. Only locally cache above a certain hit threshold
Remove unneeded local
Don't pass real length into pad
Make min_gzip_size a Storage attribute
Cleaner options handling
Remove debugging line
More descriptive var name. Better local hit test
Use 30 second window do determine local cache-ability
Always locally store metadata

Local caching of metadata is cheap, improves response
time for 304s and generates less memcached traffic.
Only record local hits when entity is local hit
Use ngx.CRIT log level for errors so they show up in log.error