View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
1829 | Composr | core_themeing | public | 2015-03-13 08:44 | 2020-03-20 23:14 |
Reporter | Chris Graham | Assigned To | Chris Graham | ||
Priority | normal | Severity | feature | ||
Status | resolved | Resolution | fixed | ||
Summary | 1829: Allow coding up of template dependencies | ||||
Description | If you include one template in another via Tempcode include, or in LESS, then if the included file changes, Composr does not know to recompile the referenced file. Create some kind of system for coding up dependencies. Possibly via _config.php | ||||
Tags | Roadmap: v11 partial implementation | ||||
Attach Tags | |||||
Time estimation (hours) | 2 | ||||
Sponsorship open | |||||
|
Making it automated would be cool.. e.g., cache a list of dependencies on compilation of a template and check all of them for modifications when the template is called. That's one more cache to deal with though lol. |
|
Would be cool, but how do we do it for LESS? Either we'd need to hook into the lib, do our own parsing, or a regexp hack. And then, that's just for one possible inclusion method. Too much work ;). Better just to KISS and solve it with 95% okayness in much less time. |
|
A nicer compromise might be to autodetect INCLUDE syntax, and also have wider flexibility via autodetecting any substrings like... dep:custom.less Could be encapsulated using whatever native comments, e.g. /*dep:custom.less*/ {$,dep:FORM_STANDARD_END.tpl} |
|
Done a very basic implementation for programmers, will leave this issue open in case we want to do the more sophisticated implementation. |
|
Due to the nature of v11 JS, I have hard-coded some automatic decaching for global.js dependencies. |
|
I made these notes on a plane, without having an Internet connection (so I could not compare to what else is written in this issue)... New function, can_use_cache($cache_type, $file_path, $cache_path) -- implements smart_decaching (if enabled), and checks of various cache/keep_cache/cache_*/keep_cache_* parameters, and $SITE_INFO['dependency__' / dependencies_are_good stuff (recursively) Rename disable_smart_decaching to smart_decaching, and don't have enabled by default (due to the performance hit) Update the documentation about smart_decaching to make it clear it is not on by default, although it can be enabled via the keep_smart_decaching option New keep_cache_off_for parameter. Any cacheable asset matching that regexp will not be cached. Implemented within can_use_cache function. Documented alongside documentation about smart_decaching New automatic dependency detection support: When Tempcode is parsed with the INCLUDE directive, update a .dat file, e.g. global.css.tcp.dat Emptying the template cache (in any way) should delete the .dat files can_use_cache function will use this data, recursively Document alongside documentation about smart_decaching |
|
This is all massive overkill for a relatively rare situation. All we need is a simple keep_cache_avoid_for URL parameter that takes a regexp of what templates (etc) to temporarily not enable caching on. Then the developer can debug using that, and when done, empty the template cache. Meanwhile, the ability to hard-code dependencies is useful, so I've simply documented the simple implementation I've already done. Implementing auto-detection for that would just be bloat, too much core complexity. |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-02-02 03:13 | Chris Graham | Description Updated | |
2018-02-02 03:28 | Chris Graham | Note Added: 0005421 | |
2018-08-09 00:55 | Chris Graham | Note Added: 0005789 | |
2019-06-27 19:05 | Chris Graham | Tag Attached: Roadmap: v11 partial implementation | |
2020-03-07 21:19 | Chris Graham | Assigned To | => Chris Graham |
2020-03-07 21:19 | Chris Graham | Status | Not Assigned => Assigned |
2020-03-20 23:14 | Chris Graham | Status | Assigned => Resolved |
2020-03-20 23:14 | Chris Graham | Resolution | open => fixed |
2020-03-20 23:14 | Chris Graham | Note Added: 0006477 |