Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions web/app/themes/mitlib-parent/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ function override_cache_default_max_age() {
return 1 * HOUR_IN_SECONDS;
} elseif ( '/exhibits' == $site && is_page( 'current-upcoming-past-exhibits' ) ) { // The exhibits site composite listing.
return 1 * HOUR_IN_SECONDS;
} elseif ( is_page_template( 'templates/page-location.php' ) || is_page_template( 'templates/page-location-2021.php' ) ) {
return 1 * HOUR_IN_SECONDS;
Comment on lines +142 to +143

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I agree with extraction in this case. Line 282 isn't a clean repetition of this condition, because that check includes the study spaces page:

	if ( is_page_template( 'templates/page-location-2021.php' ) || is_page_template( 'templates/page-location.php' ) || is_page_template( 'templates/page-study-spaces.php' ) ) {
		wp_enqueue_script( 'parent-hours' );
	}

Line 560 is a better match, but on the whole that's now a false promise of abstraction because we'd still need to be aware that there's this one helper method that we need to maintain while there are a lot of other bespoke checks around the source code.

} else { // All other content should be cached for a week.
return 1 * WEEK_IN_SECONDS;
}
Expand Down