File tree Expand file tree Collapse file tree 2 files changed +0
-30
lines changed
Expand file tree Collapse file tree 2 files changed +0
-30
lines changed Original file line number Diff line number Diff line change @@ -84,35 +84,6 @@ sub startup {
8484 $self -> helper(logAttempt => sub { shift ; $resultsLog -> info(@_ ); });
8585 }
8686
87- # Add Cache-Control and Expires headers to static content from webwork2_files
88- if (my $STATIC_EXPIRES = $self -> config(' STATIC_EXPIRES' )) {
89- $STATIC_EXPIRES = int ($STATIC_EXPIRES );
90- my $cache_control_setting = " max-age=$STATIC_EXPIRES " ;
91- my $no_cache_setting = ' max-age=1, no-cache' ;
92- $self -> hook(
93- after_dispatch => sub {
94- my $c = shift ;
95-
96- # Only process if file requested is under webwork2_files
97- return unless ($c -> req-> url-> path =~ ' ^/webwork2_files/' );
98-
99- if ($c -> req-> url-> path =~ ' /tmp/renderer' ) {
100- # Treat problem generated files as already expired.
101- # They should not be cached.
102- $c -> res-> headers-> cache_control($no_cache_setting );
103- $c -> res-> headers-> header(
104- Expires => Mojo::Date-> new(time - 86400) # expired 24 hours ago
105- );
106- } else {
107- # Standard "static" files.
108- # They can be cached
109- $c -> res-> headers-> cache_control($cache_control_setting );
110- $c -> res-> headers-> header(Expires => Mojo::Date-> new(time + $STATIC_EXPIRES ));
111- }
112- }
113- );
114- }
115-
11687 # Models
11788 $self -> helper(newProblem => sub { shift ; Renderer::Model::Problem-> new(@_ ) });
11889
Original file line number Diff line number Diff line change 66 webworkJWTsecret => 'private',
77 SITE_HOST => 'http://localhost:3000',
88 CORS_ORIGIN => '*',
9- STATIC_EXPIRES => 86400,
109 STRICT_JWT => 0,
1110 FULL_APP_INSECURE => 0,
1211 INTERACTION_LOG => 0,
You can’t perform that action at this time.
0 commit comments