2. Who am I?
• Performance and security work
at the Code Distillery
• Framework and security teams,
membership committee
• Foundation board member
Friday, 12 October 12 2
3. Who am I?
• Zope / Plone core developer
• Silly accent. Sorry.
• Not a morning person. Sorry.
Friday, 12 October 12 3
4. Performance…
• Plone is pretty damn fast
• Low edit sites are really easy
to make fly
• Runs fine on a 256mb VM
Friday, 12 October 12 4
5. Performance…
• plone.app.caching takes about
5 minutes to configure
• Add Varnish and it goes really
rather quick
• Writing is harder
Friday, 12 October 12 5
8. … for Product Developers
• Security isn’t the sole
responsibility of the integrator
• Neither is performance
• Everyone is careful about the
code they write
Friday, 12 October 12 8
10. Recap
• Don’t add things to the
catalog if you can help it
• If you have to, use an indexer,
not just a raw FieldIndex
Friday, 12 October 12 10
11. Recap
• Build your types on
Dexterity, not Archetypes
• If you’re not sure what
structure to use for your
data, the answer is OOBTree
Friday, 12 October 12 11
12. Recap
• Avoid big object churn by
keeping Lengths of things
you need
• Find a balance between huge
objects and annotation soup
Friday, 12 October 12 12
13. Recap
• If you see for loops inside
for loops you’re probably
missing a simpler way
• Don’t forget sets and
itertools, they’re good
Friday, 12 October 12 13
14. … for Product Developers
• Very few people are using the
tools we have available
• Equally true for publicly available
products as for policies
Friday, 12 October 12 14
17. Access time for a browser view through Varnish
80ms
23
60ms
56 processing
connect
40ms
20ms
0ms 0
without cache:ruleset with cache:ruleset
I love this chart
Friday, 12 October 12 17
18. plone.app.caching
• Assign caching rules directly to contexts by
interface
• Can map to an operation, like
plone.app.caching.strongCaching
• or to a ruleset, like
plone.content.itemView
Friday, 12 October 12 18
19. psst, integrators!
• You can have commit access
today
• If your favourite product doesn’t
have rulesets defined, add them
• I’ll bring “I cleaned up your mess”
stickers to Brasília
Friday, 12 October 12 19
20. Edge Side Includes
photo (c) http://www.flickr.com/photos/fornal/
Friday, 12 October 12 20
21. ESIs
• Varnish is your friend
• Lets integrators do page
composition
• but easy to leak data
Friday, 12 October 12 21
23. ESI
• Suddenly, cache hits for
logged in users!
• aaaand, cache hits on private
pages for anonymous
• Really rather bad
Friday, 12 October 12 23
24. ESI
• Set ETags to
roles|lastModified?
• ETags can be faked
• Still leaks data
Friday, 12 October 12 24
25. ESI
• Integrators will still have to
segment their cache manually
• Hard work
• A lot easier if add-ons are
written with this in mind
Friday, 12 October 12 25
26. ESI
• Plan your templates for eventual
ESIs
• Many small templates is
appropriate, lets them be
customised
Friday, 12 October 12 26
27. ESI
• If there is a block of markup that
is mostly static but uses the user
in some bit, make sure that’s
separated out
• Integrators shouldn’t need more
than a few minutes to add ESI to
your templates
Friday, 12 October 12 27
29. Testing
• Far too few people run
automated tests on their
caching
• Well, far too few people run
automated tests at all
Friday, 12 October 12 29
30. Testing
• If you have plone.app.testing
based tests already it’s easyish
• Create a new layer using a
ZServer and start up Varnish
• Make some testbrowser calls
Friday, 12 October 12 30
32. Utility packages
• We need helper classes and
methods for writing caching tests
• Actual tests in popular packages,
as examples
Friday, 12 October 12 32
33. Rulesets
• The current plone.app.caching
rulesets are integrator focused
• We need some standard ones
for product developers to use
Friday, 12 October 12 33
34. The Code Distillery
Bristol
Questions?
Want help putting this into practice?
sales@thedistillery.eu
Friday, 12 October 12 34