[Add out caching to bee-page-component clinton@unknownlamer.org**20081212213957 * New field in bee-page stores the md5sum of the markdown source ] hunk ./src/web-common.lisp 31 + (hash :reader page-content-hash) hunk ./src/web-common.lisp 34 -(defcomponent bee-page-component (bee-widget) - ((name :initarg :name :accessor page-name))) +(defmethod (setf page-content) :after (content (page bee-page)) + (setf (slot-value page 'hash) (md5:md5sum-sequence content))) + +(defcomponent bee-page-component (bee-widget cache-component-mixin) + ((name :initarg :name :accessor page-name) + (hash :initform nil :accessor page-hash))) + +(defmethod component-cache-invalid-p ((c bee-page-component)) + (not (equalp (page-hash c) + (page-content-hash (get-instance-by-value 'bee-page + 'name (page-name c)))))) + +(defmethod note-cache-updated ((c bee-page-component) output) + (setf (page-hash c) + (page-content-hash (get-instance-by-value 'bee-page + 'name (page-name c)))))