Skip to content

Commit

Permalink
Add significant improvements to the dashboard interacting with cache
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Mar 8, 2023
1 parent eef22f8 commit cf6736b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
6 changes: 3 additions & 3 deletions authentic-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,10 @@ sub print_easypie_chart
sub theme_list_combined_system_info
{
my $skipmods;
my $bgcall = post_has('xhr-info');
my $nocache = post_has('xhr-info') || post_has('no-cache') || string_contains(get_env('query_string'), 'no-cache');
my $is_webmin = get_product_name() eq 'webmin';
my @opts = ("combined-system-info-$remote_user", $theme_config{'settings_sysinfo_cache_timeout'}, 1);
if (!$bgcall && $is_webmin) {
if (!$nocache && $is_webmin) {
$skipmods = ['package-updates', 'webmin', 'cpuio'];
my $combined_system_info_cache = theme_cached($opts[0], undef, undef, $opts[1]);
return @{$combined_system_info_cache}
Expand All @@ -549,7 +549,7 @@ sub theme_list_combined_system_info
},
undef,
$skipmods);
if ($bgcall && $is_webmin) {
if ($nocache && $is_webmin) {
theme_cached($opts[0], \@combined_system_info, undef, $opts[2]);
}
return @combined_system_info;
Expand Down
12 changes: 12 additions & 0 deletions authentic.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,18 @@ sub theme_redirect
my $noredir = $gconfig{'webprefixnoredir'};
my $relredir = $gconfig{'relative_redir'};
my ($arg1, $arg2) = ($_[0], $_[1]);

# Clean redirected links query string if requested
if ($ENV{'REQUEST_URI'} =~ /no-query=string/) {
my $nocache = "no-cache=1";
$arg1 =~ s/\.cgi.*/.cgi/;
$arg2 =~ s/\.cgi.*/.cgi/;
if ($ENV{'REQUEST_URI'} =~ /\Q$nocache\E/) {
$arg1 .= "?" . $nocache;
$arg2 .= "?" . $nocache;
}
}

my ($link) = $arg1 || $arg2;
my ($url) = $arg2;

Expand Down
2 changes: 1 addition & 1 deletion unauthenticated/css/bundle.min.css

Large diffs are not rendered by default.

Binary file modified unauthenticated/css/bundle.min.css.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion unauthenticated/js/bundle.min.js

Large diffs are not rendered by default.

Binary file modified unauthenticated/js/bundle.min.js.gz
Binary file not shown.

0 comments on commit cf6736b

Please sign in to comment.