Changeset 2957


Ignore:
Timestamp:
2002-02-09T20:37:28+13:00 (22 years ago)
Author:
sjboddie
Message:

Changed my mind about last changes (adding http headers to prevent caching).
I've returned it to how it was (just a Last-Modified header being sent for
collection-specific pages) and added some commented out code which may be
uncommented to prevent caching (when do interface development work for
example).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/receptionist.cpp

    r2942 r2957  
    757757    // content response
    758758
    759     // prevent dynamic content from being cached
    760     contentout << text_t2ascii
    761                << "Expires: 0\n"
    762                << "Cache-Control: no-cache, must-revalidate\n";
    763 
    764759    // use the later of build.cfg and collect.cfg modification times
    765760    // as the Last-Modified: header, for caching values
     
    803798      }
    804799    }
     800
     801    /*
     802      // This block of code should prevent the users browser from caching
     803      // the page. It may be useful to uncomment this code and comment out
     804      // that directly above (which sets a "Last-Modified" header) when
     805      // doing interface development work where a given page may be
     806      // changing often.
     807
     808    contentout << "Expires: Mon, 26 Jul 1997 05:00:00 GMT\n"; // date in the past
     809    tm *tm_ptr = NULL;
     810    time_t t = time(NULL);
     811    tm_ptr = gmtime (&t);
     812    if (tm_ptr != NULL) {
     813      char *timestr = new char[128];
     814      strftime (timestr, 128, "%a, %d %b %Y %H:%M:%S", tm_ptr);
     815      contentout << "Last-Modified: " << timestr << " GMT\n"; // always modified
     816      delete timestr;
     817    }
     818    contentout << "Cache-Control: no-cache, must-revalidate\n"; // HTTP/1.1
     819    contentout << "Pragma: no-cache\n"; // HTTP/1.0
     820    */
    805821
    806822    contentout << text_t2ascii << "Content-type: " << response_data << "\n\n";
Note: See TracChangeset for help on using the changeset viewer.