Cache stays on?
Permalink
I don't think I understand how the caches work in 5.7. Working on a new site, I had them off from the start, but getting closer to launch, so I turned the caches on and saw a nice speed increase, did some testing around, then I wanted to turn the caches off again to work with the LESS CSS files, but it appears the cache is still caching, despite repeated clears, manually deleting cache from the Files dir, etc. I can delete the files from that dir, and double check caches are off in Dashboard, and when I reload the pages, all my CSS is again appearing in Files > Cache. This is making it extremely difficult to update CSS via LESS.
When I started the site, I was including my LESS in "normal" fashion like I would have used plain CSS, and using a JS to parse it. See:
Then I changed at some point to using C5's parser based on something I found in the forums or docs, this was faster to parse it seemed:
Is THAT why it appears to still be caching?
Hope this makes sense... any clarification appreciated!
When I started the site, I was including my LESS in "normal" fashion like I would have used plain CSS, and using a JS to parse it. See:
<!-- Less --> <link href="<?php echo $view->getThemePath()?>/assets/less/layout.less" rel="stylesheet/less" type="text/css"/> <link href="<?php echo $view->getThemePath()?>/assets/less/color.less" rel="stylesheet/less" type="text/css"/> <link href="<?php echo $view->getThemePath()?>/assets/less/mixins.less" rel="stylesheet/less" type="text/css"/> <link href="<?php echo $view->getThemePath()?>/assets/less/features.less" rel="stylesheet/less" type="text/css"/> <script src="<?php echo $view->getThemePath()?>/assets/plugins/less-1.7.0.min.js" type="text/javascript"></script> <script type="text/javascript">less.watch();</script>
Then I changed at some point to using C5's parser based on something I found in the forums or docs, this was faster to parse it seemed:
<!-- C5 Less inclusion - using C5's less parser instead of the client-side javascript --> <link href="<?=$view->getStyleSheet('layout.less')?>" rel="stylesheet" type="text/css"> <link href="<?=$view->getStyleSheet('color.less')?>" rel="stylesheet" type="text/css"> <link href="<?=$view->getStyleSheet('mixins.less')?>" rel="stylesheet" type="text/css"> <link href="<?=$view->getStyleSheet('features.less')?>" rel="stylesheet" type="text/css">
Is THAT why it appears to still be caching?
Hope this makes sense... any clarification appreciated!
I believe that the files will still appear in the cache directory – because they have to appear somewhere in your local file system in order to be included by your page. But when the cache is off it should re-generate those files on every page load.
If I deleted them, they did visually regenerate on each load, but they would regenerate with the same old declarations, not the updated ones from the .less file. Upon inspection, the inspector still showed the old declarations. Still haven't figured this out, but fortunately I am about done modifying the CSS on this site I think.
Did you ever get this resolved?
Sort of.... renamed the LESS file, and it picked up revisions. But looking back at files, I apparently only had to iterate the version number once, so maybe that was enough to "break the grip" on the old filename.