webmcp
annotate framework/env/request/allow_caching.lua @ 428:52ebde158c92
Fixed minor glitch regarding floating point numbers (e.g. 0.009) in JSON encoder; Distinguish between integers and floats in JSON encoder if Lua version >= 5.3
| author | jbe | 
|---|---|
| date | Thu Jan 14 17:40:49 2016 +0100 (2016-01-14) | 
| parents | fa3a5bba0067 | 
| children | 
| rev | line source | 
|---|---|
| jbe@291 | 1 --[[-- | 
| jbe@291 | 2 request.allow_caching() | 
| jbe@291 | 3 | 
| jbe@291 | 4 Includes a "Cache-Control" header in the response that marks the content as cachable. | 
| jbe@291 | 5 | 
| jbe@291 | 6 --]]-- | 
| jbe@291 | 7 | 
| jbe@291 | 8 function request.allow_caching() | 
| jbe@291 | 9 request.configure(function() | 
| jbe@291 | 10 request._cache = true | 
| jbe@291 | 11 end) | 
| jbe@291 | 12 end |