Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

dont cache things without a body or fear the wrath of the spinning br…

…owser
  • Loading branch information...
commit dd60cecd1d9586e406a9a7fdc59d42c9bf83a40b 1 parent 0cc1295
Tom Kapanka spanktar authored

Showing 2 changed files with 16 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 CHANGES.txt
  2. +13 0 plone/app/caching/operations/utils.py
5 CHANGES.txt
@@ -3,8 +3,9 @@ Changelog
3 3
4 4 1.0.2 (unreleased)
5 5 ~~~~~~~~~~~~~~~~~~
6   -
7   -- Nothing changed yet.
  6 +- Handle caching of resource registries in RAM cache by not storing empty
  7 + bodies in the RAMCache
  8 + [eleddy with major tseaver support]
8 9
9 10
10 11 1.0.1 (2012-01-26)
13 plone/app/caching/operations/utils.py
@@ -680,6 +680,19 @@ def storeResponseInRAMCache(request, response, result, globalKey=PAGE_CACHE_KEY,
680 680 cache = getRAMCache(globalKey)
681 681 if cache is None:
682 682 return
  683 +
  684 + """
  685 + Resource registries have no body. If we put them in the cache the content
  686 + type headers will indicate length and the body will be '', causing the browser
  687 + to just spin. Furthermore, I doubt we ever want to cache an empty result:
  688 + it's an indication that something went wrong somewhere.
  689 +
  690 + This does mean that any resources will not be cached in ram. There is
  691 + potentially another fix but I doubt long term it's ever the right thing to
  692 + do.
  693 + """
  694 + if result == '':
  695 + return
683 696
684 697 status = response.getStatus()
685 698 headers = dict(request.response.headers)

0 comments on commit dd60cec

Please sign in to comment.
Something went wrong with that request. Please try again.