-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible problem of Caching in 2.5.0 (vs 1.7.3) #2545
Comments
Can you add more info? can you help with debugging for us? That would help us fix it quicker. |
Hi luke, Here my LESS options (nont changed while switch LESS version):
In details, if I make an edit in a .less file and reload page, I see these differences between 2 LESS versions (I tried with and without forcing cache refresh on reload):
In other words: |
Basically: "sync" XHR is out. It was throwing warnings in browsers as the option itself is deprecated. The reason why sync XHR was an option in the first place was to not show FOUC (flash of unstyled content). But that's only one way to solve that problem, and sync XHR was deprecated as a feature for browsers because it's disastrous for page performance. What #2735 does (which was released in 2.6.0) is block rendering until styles are finished WITHOUT blocking XHR. I found this made page loading about 10x faster. However, you'll still get FOUC unless you set async: false. The docs need to be updated in this regard, because that technically means that "async" now refers to page rendering and not XHR requests. (XHR is always async as of 2.6.0.) I'm recommending that async: false becomes the default option, since it no longer has the performance hit that it used to. So, in short, you probably don't want to use either 1.7.3 nor 2.5.0 if you're using Less in the browser. |
So I guess it's safe to close this issue as not applicable anymore. |
@seven-phases-max I think so. Although, just to fully address the original issue, which was about the cache not refreshing after edits, I think that part too is actually as designed. The cache doesn't refresh unless the root .less file is updated. Probably it seemed to be refreshing the cache for any imports just because it was never caching. Until those recent updates, the cache wasn't used at all in a number of scenarios. |
Hi recently uploaded my version of LESS from 1.7.3 to 2.5.0.
It seems that new version has a "sort of cache" because is quickier to load but in the same time does not process recently modified files.
I correctly set LESS options with "env:development" (same setting for 1.7.3) and tried also to change settings about "aSync". Nothing.
Back to 1.7.3, everything return slower but edits are correctly recognized and processed...
The text was updated successfully, but these errors were encountered: