View Issue Details

IDProjectCategoryView StatusLast Update
0023324mantisbtperformancepublic2017-10-08 23:52
ReportercproensaAssigned Tocproensa 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version2.7.0 
Target Version2.7.0Fixed in Version2.7.0 
Summary0023324: Generated css, js code should be cached by browser
Description

Generated files like:

  • status_config.php
  • javascript_config.php
  • javascript_translations.php

Are currently not cached by clients, increasing load time and server request processing.

Usually, the content of those files is not changed unless there is a change in global configuration, so it's safe to be cached.

TagsNo tags attached.

Relationships

related to 0023310 closedatrol Unused CSS delivered 

Activities

cproensa

cproensa

2017-09-06 13:09

developer   ~0057629

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

atrol

atrol

2017-09-06 13:24

developer   ~0057631

so it's safe to be cached.

Sure?
The content can be user, project and language dependant

cproensa

cproensa

2017-09-06 13:40

developer   ~0057632

The content can be user, project and language dependant

in the same browser?
maybe driver by logged user

let's see if that can be accounted with some sort of headers

atrol

atrol

2017-09-06 13:54

developer   ~0057633

Not sure we are talking about the same thing.

E.g status_config.php generates CSS code (colors) based on config_get( 'status_enum_string');
You can have different settings for status_enum_string for different projects, so whenever you change current project, the generated CSS code might change.

E.g. javascript_translations.php generates JS code based on current language setting.
You can't use the cached version if you change your language via "My Account" settings.

cproensa

cproensa

2017-09-06 14:29

developer   ~0057634

Last edited: 2017-09-06 17:56

View 2 revisions

status_config.php

This could be dependant on user, but not on project.
Even if the status colours could be configured at project level, the behaviour won't be correct.
Having different settings for status_enum_string for different projects, would be even more chaotic (think about filters)

javascript_config.php

dependant on user, but current content i think it's not based on project:
print_config_value( 'datetime_picker_format' );. I'd say this it's not a project specific config (or it shouldn't, at least)
print_config_value( 'short_path' );. This should not even be overridable

javascript_translations.php

Dependant on language (not on user directly), but not on poject.

cproensa

cproensa

2017-09-06 14:32

developer   ~0057635

Not sure we are talking about the same thing.

yes, i understand.
I mean: somehow, those dependences can be used as a differentiator for the resource, so every request for the same combination of properties is cached

Related Changesets

MantisBT: master 712edd2d

2017-09-06 12:54:25

cproensa


Committer: vboctor Details Diff
Allow caching of generated js/css files

Allow client caching of dynamically generated css and js files.
Default headers disable explicitly caching of application pages, but
these generated files don't change usually between page loads.
By disabling default headers, the cacheability is defined by the server
configuration.

The included resources are referenced by a URL query built with a
parameter that differentiates content that may have changed based on
current user, project, language, etc. This parameter would force a
reload in case the content may be different from the cached version.

Fixes: 0023324
mod - core/helper_api.php Diff File
mod - core/html_api.php Diff File
mod - css/status_config.php Diff File
mod - javascript_config.php Diff File
mod - javascript_translations.php Diff File

Issue History

Date Modified Username Field Change
2017-09-06 13:06 cproensa New Issue
2017-09-06 13:06 cproensa Relationship added related to 0023310
2017-09-06 13:09 cproensa Note Added: 0057629
2017-09-06 13:24 atrol Note Added: 0057631
2017-09-06 13:40 cproensa Note Added: 0057632
2017-09-06 13:54 atrol Note Added: 0057633
2017-09-06 14:29 cproensa Note Added: 0057634
2017-09-06 14:32 cproensa Note Added: 0057635
2017-09-06 17:56 cproensa Note Edited: 0057634 View Revisions
2017-10-08 11:54 vboctor Changeset attached => MantisBT master 712edd2d
2017-10-08 11:54 cproensa Assigned To => cproensa
2017-10-08 11:54 cproensa Status new => resolved
2017-10-08 11:54 cproensa Resolution open => fixed
2017-10-08 11:54 cproensa Fixed in Version => 2.7.0
2017-10-08 12:49 atrol Target Version => 2.7.0
2017-10-08 23:52 vboctor Status resolved => closed