@@ -103,13 +103,16 @@ const Tab kTabs[] = {
103103class AdminHtml {
104104 public:
105105 AdminHtml (StringPiece current_link, StringPiece head_extra,
106- AdminSite::AdminSource source, AsyncFetch* fetch ,
107- MessageHandler* handler)
106+ AdminSite::AdminSource source, Timer* timer ,
107+ AsyncFetch* fetch, MessageHandler* handler)
108108 : fetch_(fetch),
109109 handler_ (handler) {
110110 fetch->response_headers ()->SetStatusAndReason (HttpStatus::kOK );
111111 fetch->response_headers ()->Add (HttpAttributes::kContentType , " text/html" );
112112
113+ int64 now_ms = timer->NowMs ();
114+ fetch->response_headers ()->SetLastModified (now_ms);
115+
113116 // Let PageSpeed dynamically minify the html, css, and javasript
114117 // generated by the admin page, to the extent it's not done
115118 // already by the tools. Note, this does mean that viewing the
@@ -211,7 +214,7 @@ void AdminSite::ConsoleHandler(const SystemRewriteOptions& global_options,
211214 // TODO(sligocki): Do we want to have a minified version of console CSS?
212215 GoogleString head_markup = StrCat (
213216 " <style>" , CSS_console_css, " </style>\n " );
214- AdminHtml admin_html (" console" , head_markup, source, fetch,
217+ AdminHtml admin_html (" console" , head_markup, source, timer_, fetch,
215218 message_handler_);
216219 if (statistics_enabled && logging_enabled && log_dir_set) {
217220 fetch->Write (" <div class='console_div' id='suggestions'>\n "
@@ -267,7 +270,7 @@ void AdminSite::StatisticsHandler(const RewriteOptions& options,
267270 Statistics* stats) {
268271 GoogleString head_markup = StrCat (
269272 " <style>" , CSS_statistics_css, " </style>\n " );
270- AdminHtml admin_html (" statistics" , head_markup, source, fetch,
273+ AdminHtml admin_html (" statistics" , head_markup, source, timer_, fetch,
271274 message_handler_);
272275 // We have to call Dump() here to write data to sources for
273276 // system/system_test.sh: Line 79. We use JS to update the data in refreshes.
@@ -293,7 +296,8 @@ void AdminSite::GraphsHandler(const RewriteOptions& options,
293296 }
294297 GoogleString head_markup = StrCat (
295298 " <style>" , CSS_graphs_css, " </style>\n " );
296- AdminHtml admin_html (" graphs" , head_markup, source, fetch, message_handler_);
299+ AdminHtml admin_html (" graphs" , head_markup, source, timer_, fetch,
300+ message_handler_);
297301 fetch->Write (" <div id='cache_applied'>Loading Charts...</div>"
298302 " <div id='cache_type'>Loading Charts...</div>"
299303 " <div id='ipro'>Loading Charts...</div>"
@@ -367,7 +371,8 @@ void AdminSite::ConsoleJsonHandler(const QueryParams& params,
367371
368372void AdminSite::PrintHistograms (AdminSource source, AsyncFetch* fetch,
369373 Statistics* stats) {
370- AdminHtml admin_html (" histograms" , " " , source, fetch, message_handler_);
374+ AdminHtml admin_html (" histograms" , " " , source, timer_, fetch,
375+ message_handler_);
371376 stats->RenderHistograms (fetch, message_handler_);
372377}
373378
@@ -551,7 +556,7 @@ void AdminSite::PrintCaches(bool is_global, AdminSource source,
551556 } else {
552557 GoogleString head_markup = StrCat (
553558 " <style>" , CSS_caches_css, " </style>\n " );
554- AdminHtml admin_html (" cache" , head_markup, source, fetch,
559+ AdminHtml admin_html (" cache" , head_markup, source, timer_, fetch,
555560 message_handler_);
556561
557562 fetch->Write (" <div id='show_metadata'>" , message_handler_);
@@ -624,15 +629,16 @@ void AdminSite::PrintCaches(bool is_global, AdminSource source,
624629void AdminSite::PrintNormalConfig (
625630 AdminSource source, AsyncFetch* fetch,
626631 SystemRewriteOptions* global_system_rewrite_options) {
627- AdminHtml admin_html (" config" , " " , source, fetch, message_handler_);
632+ AdminHtml admin_html (" config" , " " , source, timer_, fetch, message_handler_);
628633 HtmlKeywords::WritePre (
629634 global_system_rewrite_options->OptionsToString (), " " ,
630635 fetch, message_handler_);
631636}
632637
633638void AdminSite::PrintSpdyConfig (AdminSource source, AsyncFetch* fetch,
634639 const SystemRewriteOptions* spdy_config) {
635- AdminHtml admin_html (" spdy_config" , " " , source, fetch, message_handler_);
640+ AdminHtml admin_html (" spdy_config" , " " , source, timer_, fetch,
641+ message_handler_);
636642 if (spdy_config == NULL ) {
637643 fetch->Write (" SPDY-specific configuration missing." , message_handler_);
638644 } else {
@@ -646,7 +652,8 @@ void AdminSite::MessageHistoryHandler(const RewriteOptions& options,
646652 // Request for page /mod_pagespeed_message.
647653 GoogleString log;
648654 StringWriter log_writer (&log);
649- AdminHtml admin_html (" message_history" , " " , source, fetch, message_handler_);
655+ AdminHtml admin_html (" message_history" , " " , source, timer_, fetch,
656+ message_handler_);
650657 if (message_handler_->Dump (&log_writer)) {
651658 fetch->Write (" <div id='log'>" , message_handler_);
652659 // Write pre-tag and color messages.
0 commit comments