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 {
84
84
$self -> helper(logAttempt => sub { shift ; $resultsLog -> info(@_ ); });
85
85
}
86
86
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
-
116
87
# Models
117
88
$self -> helper(newProblem => sub { shift ; Renderer::Model::Problem-> new(@_ ) });
118
89
Original file line number Diff line number Diff line change 6
6
webworkJWTsecret => 'private',
7
7
SITE_HOST => 'http://localhost:3000',
8
8
CORS_ORIGIN => '*',
9
- STATIC_EXPIRES => 86400,
10
9
STRICT_JWT => 0,
11
10
FULL_APP_INSECURE => 0,
12
11
INTERACTION_LOG => 0,
You can’t perform that action at this time.
0 commit comments