View Issue Details

IDProjectCategoryView StatusLast Update
0033482mantisbtbugtrackerpublic2024-01-15 03:19
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Target Version2.27.0Fixed in Version2.27.0 
Summary0033482: Use config API to access allow_browser_cache
Description

Until now, $g_allow_browser_cache config was handled in a non-standard way in http_caching_headers(), i.e. by referencing it as a global variable instead of retrieving its value with config_get_global().

This is a leftover from an old usage allowing to selectively enable caching for some pages, that was removed several years ago (see 0025969).

Moreover, the setting is commented out in config_default_inc.php (i.e. not defined) instead of being set to OFF.

Additional Information

This follows discussion started in PR 1925 where @vboctor suggested to

leave [...] $g_allow_browser_cache disabled until:

  • Update the code fetching them to use the standard config_get_global() method.
  • Consider them ON only when their value is set to ON.
  • Add these two config options to $g_global_settings array.
TagsNo tags attached.

Relationships

related to 0025969 closedcproensa bug_report_page is forced to be cached 
related to 0026477 acknowledged Removing the caching of pages with validation gives returns the "empty form on back" bug 0003728 

Activities

dregad

dregad

2024-01-07 12:38

developer   ~0068427

I'm not 100% sure that this config is actually needed - or even wanted - anymore. As pointed out by @cproensa some years back, enabled cache is causing several unwanted side effects (see 0026477:0063293).

Anyway for now I'll just stick to @vboctor's suggestion to move the global variable references to config API calls. We can always remove the config later on.

dregad

dregad

2024-01-07 13:00

developer   ~0068428

PR https://github.com/mantisbt/mantisbt/pull/1956

Related Changesets

MantisBT: master 2c09d01e

2024-01-07 12:57

dregad


Details Diff
Use config API to access allow_browser_cache

Until now $g_allow_browser_cache config was handled in a non-standard
way in in http_caching_headers(), i.e. by referencing it as a global
variable instead of retrieving its value with config_get_global().

Moreover, the setting was commented out in config_default_inc.php
(i.e. not defined) instead of being set to OFF.

This follows up on discussion in PR
https://github.com/mantisbt/mantisbt/pull/1925

Fixes 0033482
Affected Issues
0033482
mod - config_defaults_inc.php Diff File
mod - core/http_api.php Diff File