How does Matrix determine Last-Modified for Site Index Pages


(Douglas (@finnatic at @waikato)) #1

We have a site with an index page where the page is available at both server/site and server/site/page.

 

When I review the headers being output for the page at both addresses, the headers are mostly consistent - but the Last-Modified header was being returned with different values e.g.

 

server/site - 

Last-Modified: Mon, 22 Sep 2014 23:30:00 GMT

 
server/site/page - 
Last-Modified: Fri, 19 Sep 2014 03:45:36 GMT
 
The last-updated time information on the asset corresponds with the latter (Friday) ...
 
I've cleared the cache on the asset, and after that, both addresses are showing the Friday time for Last-Modified which has me scratching my head a little.  I did make a change this morning to add a customisation on the site asset matching one on the index page asset (expiry of 5 minutes instead of 24 hours) but I don't see why that would reset the last modified to an earlier date.
 
Anyone have ideas where Matrix was sourcing the Last-Modified data for server/site from ?

(Edison Wang) #2

Matrix gets the last modifier date from all assets that gets loaded into that page request. Matrix compares and grab the max value (the latest updated time stamp) of them, and use that as Last-Modified header in response.

 

However, Matrix also caches that result in its internal cache system (Cache Manager), so it doesn't need to repeatedly do above processing, when browser keeps asking the same url.

 

Both of above 2 things respect your current URL. Different URL means different array of assets could get loaded into system, and means the different last-modified timestamp of those loaded assets. The cache entry would also respect your current URL, so if you clear cache with /_recache suffix, it would only clear the cache entry for that URL.


(Douglas (@finnatic at @waikato)) #3

Matrix gets the last modifier date from all assets that gets loaded into that page request. Matrix compares and grab the max value (the latest updated time stamp) of them, and use that as Last-Modified header in response.

 

What about when the request is for the site address, and the site is then using the page content from the index page e.g. same assets, different url because of how Matrix handles the site index page?  I'm seeing different Last-modified dates for the two different addresses, which suggests to me that Matrix isn't properly determining the last modified date for the site address asset.

 

Also, has that changed?  I have a recollection of Matrix behaviour not being to get the max last updated time stamp from a page's component parts, but that's from ~2009 ...


(Douglas (@finnatic at @waikato)) #4

And just to provide more detail.

 

/site/ is showing the last modified time for the index page - /site/home

 

/site/home is showing a last modifed time based I believe on the max last modified time of an asset displayed on that page via an asset listing (e.g. page itself and asset listing have last modified prior to last modified of asset shown by said asset listing).

 

Latter works well with provided an accurate last-modified based on the content in the page.  Former does not.