You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main problem is that when i make changes to the .less file, which was imported in another file of the same extension, the page doesn't change.
For example:
global.less:
body {
--color: #000; /* previously was #fff */
}
page.less
@import url("global.less");
body {
background-color: var(--color);
}
And after the changes were made and the browser tab has been reloaded without cache (Ctrl+Shift+R), the background-color value didn't changed - it is still #fff.
As a temporary workaround, i simply reload the page without @import url("global.less"), add the import again, reload the page, and the background changes!
After some research, i found out that the reason of this was the Apache web server - it just caches the global.less file. But i don't really know how to disable the caching of .less files. I tried creating .htaccess with the solution found on the internet, but it didn't work, I tried looking in the Apache's docs about caching module, but i didn't understand much from the docs.
There comes the question: How can i make the web server see the changes in the global.less file so i don't need to use this routine workaround mentioned earlier?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The main problem is that when i make changes to the
.less
file, which was imported in another file of the same extension, the page doesn't change.For example:
global.less
:page.less
And after the changes were made and the browser tab has been reloaded without cache (
Ctrl+Shift+R
), the background-color value didn't changed - it is still#fff
.As a temporary workaround, i simply reload the page without
@import url("global.less")
, add the import again, reload the page, and the background changes!After some research, i found out that the reason of this was the Apache web server - it just caches the
global.less
file. But i don't really know how to disable the caching of.less
files. I tried creating.htaccess
with the solution found on the internet, but it didn't work, I tried looking in the Apache's docs about caching module, but i didn't understand much from the docs.There comes the question: How can i make the web server see the changes in the
global.less
file so i don't need to use this routine workaround mentioned earlier?Beta Was this translation helpful? Give feedback.
All reactions