I republished an entire blog, and when I looked at the timestamps on the files, I did not see any recent dates. Does this mean Movable Type could not publish the templates? Or does it not update file timestamps every time a template is republished?
Not a developer? Go to MovableType.com
I republished an entire blog, and when I looked at the timestamps on the files, I did not see any recent dates. Does this mean Movable Type could not publish the templates? Or does it not update file timestamps every time a template is republished?
Charlie Gorichanaz on October 16, 2013, 3:57 a.m. Reply
Publishing anything in Movable Type will only result in a changed timestamp if the file actually gets changed. MT compares the rendered template to the existing file and only proceeds to update the file if the two are not identical.
This is true when using static publishing as well as the publishing queue. Static publishing makes use of the
rebuild_file
andrebuild_indexes
subroutines inlib/MT/WeblogPublisher.pm
. The publishing queue makes use of therebuild_from_fileinfo
subroutine in the same file, which in turn callsrebuild_file
.In
rebuild_file
andrebuild_indexes
is code like this:The
content_is_updated
subroutine is defined inlib/MT/FileMgr/Local.pm
. This checks if the Perl moduleDigest::MD5
is installed, and if it is, the comparison is done with a MD5 hash of the existing file and rendered template. If the module is not installed, the comparison is done character by character.