[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm

raeburn raeburn@source.lon-capa.org
Sun, 04 Oct 2009 03:36:09 -0000


raeburn		Sun Oct  4 03:36:09 2009 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  - Bug 6063.
    - Omit no-cache directive for XML files served by https to IE client browser.
    - Set expiration 60s in the future. 
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.498 loncom/xml/lonxml.pm:1.499
--- loncom/xml/lonxml.pm:1.498	Wed Jul  8 17:55:16 2009
+++ loncom/xml/lonxml.pm	Sun Oct  4 03:36:08 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.498 2009/07/08 17:55:16 bisitz Exp $
+# $Id: lonxml.pm,v 1.499 2009/10/04 03:36:08 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1706,6 +1706,21 @@
 	$request->set_last_modified(&Apache::lonnet::metadata($request->uri,
 							      'lastrevisiondate'));
     }
+    # Embedded Flash movies from Camtasia served from https will not display in IE
+    #   if XML config file has expired from cache.    
+    if ($ENV{'SERVER_PORT'} == 443) {
+        if ($request->uri =~ /\.xml$/) {
+            my ($httpbrowser,$clientbrowser) =
+                &Apache::loncommon::decode_user_agent($request);
+            if ($clientbrowser =~ /^explorer$/i) {
+                delete $request->headers_out->{'Cache-control'};
+                delete $request->headers_out->{'Pragma'};
+                my $expiration = time + 60;
+                my $date=strftime("%a, %d %b %Y %H:%M:%S GMT",gmtime($expiration));
+                $request->headers_out->set("Expires" => $date);
+            }
+        }
+    }
     $request->send_http_header;
     
     return OK if $request->header_only;