mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Cache content to speed up reading. Fixes #224.
Cache read content so that it doesn't have to be read next time if its source has not been modified.
This commit is contained in:
parent
de9ef74479
commit
fd77926700
9 changed files with 336 additions and 34 deletions
|
|
@ -325,6 +325,13 @@ class Content(object):
|
|||
os.path.abspath(self.settings['PATH']))
|
||||
)
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Compare with metadata and content of other Content object"""
|
||||
return other and self.metadata == other.metadata and self.content == other.content
|
||||
|
||||
# keep basic hashing functionality for caching to work
|
||||
__hash__ = object.__hash__
|
||||
|
||||
|
||||
class Page(Content):
|
||||
mandatory_properties = ('title',)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue