Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Css Caching Problem Rate Topic   - - - - -

 

Posted 04 November 2015 - 06:34 PM #1

Hello.

 

I'm having an issue with caching on v4.3.

 

On my dev server I've turned on "Rebuild cache automatically", and it is working as expected, except for rebuilding the CSS if I make changes to the LESS files. More specifically, it is failing to re-compile the CSS if the changed LESS file is @import -ed. Making changes to the top level styles.less get picked up right away, but not not if I edit any of the @imports.

 

Manually deleting the standalone.css file in cache/misc/assets/themes/[theme name]/css works, but I don't have time to do that every freaking time.

 

Have tried it on my staging server to and am seeing the same thing.

 

Anyone else got this?



 
  • NairdaCart
  • Senior Member
  • Members
  • Join Date: 18-Jul 11
  • 306 posts

Posted 05 November 2015 - 08:51 AM #2

Yep. What I do is to use the cc option on the admin.php (mysite.com/admin.php?cc) each time I make a change.



 

Posted 05 November 2015 - 12:30 PM #3

OK, that's good to know.

 

For now I think I'll edit styles.less while developing, then move my changes into the appropriate @import when everything is done. Not ideal, but quicker than clearing the cache manually each time.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11365 posts

Posted 06 November 2015 - 07:29 AM #4

Why would you want to use @import in the distributed file rather than just supplying your own css/addons/my_changes/my_changes.less?

 

This then (because it's registered with the system from your hooks/index/styles.post.tpl hook) will be rebuilt anytime the rest of the css system is rebuilt.  @imports are handled by the browser, not the system and I don't believe they are cache time sensitive.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 

Posted 10 November 2015 - 11:51 AM #5

Why would you want to use @import in the distributed file rather than just supplying your own css/addons/my_changes/my_changes.less?

 

This then (because it's registered with the system from your hooks/index/styles.post.tpl hook) will be rebuilt anytime the rest of the css system is rebuilt.  @imports are handled by the browser, not the system and I don't believe they are cache time sensitive.

 

Because I didn't know that.



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11365 posts

Posted 10 November 2015 - 07:12 PM #6

Strongly suggest you read the knowledge base about addons and their development.

 

Generally if you're not going to use the admin interface for changing themes (they overload this term to be both css styles and the skin itself) then you will want to use the my_changes addon or create a new addon.

 

If you use the theme editor then your changes are stored in the DB and applied as they change.  If you use the addon method, then you'll have a separate file that is loaded at the end that will allow you to overwrite (cascade) css changes.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.