Commits

fumanchu  committed 3e3fdb0

Changed page WhatsNewIn32

  • Participants
  • Parent commits 98c1c2d

Comments (0)

Files changed (1)

File WhatsNewIn32.wiki

-[This document is up-to-date as of [2366].
+[This document is up-to-date as of [2514].
 
 = What's new in CherryPy 3.2 =
 
 
 == Configuration ==
 
+=== New config decorator ===
+
+`cherrypy.config` can now be used as a page handler decorator. It works just like the `_cp_config` attribute; in fact, that's all it really does. But it might look better. Instead of
+
+{{{
+#!python
+    @cherrypy.expose
+    def index(self):
+        return "Hello world"
+    index._cp_config = {'response.headers.Content-Type': 'text/plain'}
+}}}
+
+you can now write:
+
+{{{
+#!python
+    @cherrypy.config(**{'response.headers.Content-Type': 'text/plain'})
+    @cherrypy.expose
+    def index(self):
+        return "Hello world"
+}}}
+
+...and it interacts with tools-as-decorators more safely, to boot.
+
 === reprconf ===
 
 Much of the basic approach to config has been isolated in its own re-usable module at `cherrypy.lib.reprconf`. This includes the `unrepr` approach to configuration (where values use Python syntax), as well as key namespaces and the ability to use dicts, filenames, or file objects.
 
 == Tools ==
 
+Most tools now take a `debug` configuration option. When `True`, they emit log entries to help diagnose problems in configuration.
+
 === JSON ===
 
 There's a new pairs of tools for JSON: `json_in` checks the Content-Type of the request and reads the body, decoding it and placing it into `request.json`; `json_out` sets the Content-Type response header and encodes the page handler output to JSON.
 
 The caching tool now stores separate responses based on varying request header values (as required by the HTTP spec).
 
-=== trailing_slash ===
+It also does antistampeding by default; that is, when one thread begins to calculate a cached response, other competing requests will wait for it to finish and then return its result.
 
-The `trailing_slash` tool has a new `status` argument, to allow XmlHttpRequest's to receive 307 redirects. Defaults to 301.
+Finally, there's more (as in "some") support for Cache-Control (and Pragma) request header values `max-age` and `no-cache`, and response header values `no-cache` and `no-store`.
 
 === autovary ===
 
 
 === auth ===
 
-Thanks to visteya, the existing `basic_auth` and `digest_auth` tools have been supplemented with `tools.auth_basic` and `tools.auth_digest`. See #913 and #914 for all the reasons why you should switch.
+Thanks to visteya, the existing `basic_auth` and `digest_auth` tools have been supplemented with `tools.auth_basic` and `tools.auth_digest`. See #913 and #914 for all the reasons why you should switch.
+
+=== trailing_slash ===
+
+The `trailing_slash` tool has a new `status` argument, to allow XmlHttpRequest's to receive 307 redirects. Defaults to 301.