Uh oh!
There was an error while loading. Please reload this page.
Remove base url from global cache prefix - #8716
Conversation
MorrisJobke
commented
Mar 7, 2018
This still gives the full deps in my env and doesn't clear them properly. :/ Let me check the prefixes on CLI and web. |
MorrisJobke
commented
Mar 7, 2018
I needed to configure Having this set up the first request to that URL still results in a 404 and the followup requests show the proper file. :/ Still weird. |
MorrisJobke
commented
Mar 7, 2018
The weird thing: the file is properly rendered, but somewhere later a 404 is triggered: |
MorrisJobke
commented
Mar 7, 2018
404 page is rendered here: server/core/Controller/JsController.php Line 74 in 4ef302c |
Codecov Report
@@ Coverage Diff @@## master #8716 +/- ##
============================================
- Coverage 31.43% 6.72% -24.72%
Complexity 25368 25368 ============================================
Files 1607 1607 Lines 95157 95153 -4 Branches 1379 1379 ============================================
- Hits 29917 6399 -23518 - Misses 65240 88754 +23514
|
MorrisJobke
commented
Mar 7, 2018
Not that weird ... this code is called before the "isCached" is called and thus fails to fetch it. Maybe there is another position where we should check for the file first. |
MorrisJobke
commented
Mar 7, 2018
@juliushaertl Still the same behavior with the most recent commit. |
MorrisJobke
commented
Mar 7, 2018
Okay - so the files are regenerated on the processing of the 404 template and not on the call to This happens first: As this is a direct access to the "to be cached" location it fails and causes a 404 page to be rendered which properly fetches the asset through the JSCombiner (and not directly): |
MorrisJobke
commented
Mar 7, 2018
@juliushaertl I tested this by calling |
juliusknorr
commented
Mar 7, 2018
Yes, the template needs to be loaded first, since that will iterate over included js/scss files and then run the combiner/scss cacher. |
juliusknorr
commented
Mar 7, 2018
It would of course make sense to trigger that also for direct requests to the getJS route. |
MorrisJobke
left a comment
There was a problem hiding this comment.
It works if I open run the repair step and call http://localhost:8000/apps/files/ - it does not work if I open http://localhost:8000/js/core/merged-template-prepend.js directly. Fine for me for now.
MorrisJobke
commented
Mar 7, 2018
Let's do this in a followup PR. |
juliusknorr
commented
Mar 7, 2018
Ok great. Let me adjust the tests then. |
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
7ef1012 to
573b940Comparejuliusknorr
commented
Mar 7, 2018
Done. Failing tests are unrelated. |
MorrisJobke
commented
Mar 7, 2018
Indeed - composer failure :/ |
juliusknorr
commented
Mar 9, 2018
backport at #8745 |


Having the base url in the global cache prefix seems to have caused the various issues with the SCSSCacher/JSCombiner. The cache was not cleared properly when using multiple domains and for cases when the base url was fetched while running form the cli.
This PR moves the base url from the global prefix to the cache prefix itself, so when calling the clear method of any ICache, all entries will properly get removed.
It will also reduce the number of used cache keys, since we don't have duplicate keys for every base url now anymore.
Fix for #8705 - I think we should merge it in addition to #8714 since this will fix the root cause, that the cache was not cleared properly.