Added a better mechanism for calculating when content was last modified for cache headers.
This commit is contained in:
parent
0e18071411
commit
f951bbed37
7 changed files with 27 additions and 78 deletions
|
|
@ -475,6 +475,11 @@ sub definition {
|
|||
fieldType=>'hidden',
|
||||
defaultValue=>'pending'
|
||||
},
|
||||
lastModified=>{
|
||||
noFormPost=>1,
|
||||
fieldType=>'hidden',
|
||||
defaultValue=>time(),
|
||||
},
|
||||
assetSize=>{
|
||||
noFormPost=>1,
|
||||
fieldType=>'hidden',
|
||||
|
|
@ -1450,14 +1455,14 @@ sub getUrl {
|
|||
|
||||
Returns the overall modification time of the object and its content in Unix
|
||||
epoch format, for the purpose of the Last-Modified HTTP header. Override this
|
||||
for subclasses that contain content that is not solely dependent on the
|
||||
revisionDate of the asset.
|
||||
for subclasses that contain content that is not solely lastModified property,
|
||||
which gets updated every time update() is called.
|
||||
|
||||
=cut
|
||||
|
||||
sub getContentLastModified {
|
||||
my $self = shift;
|
||||
return $self->get("revisionDate");
|
||||
return $self->get("lastModified");
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2238,6 +2243,7 @@ to set the keywords for this asset.
|
|||
sub update {
|
||||
my $self = shift;
|
||||
my $properties = shift;
|
||||
$properties->{lastModified} = time();
|
||||
|
||||
# if keywords were specified, then let's set them the right way
|
||||
if (exists $properties->{keywords}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue