SamC Posted October 26, 2016 Share Posted October 26, 2016 I recently moved my dev site into dropbox so I can share it between macbook/windows desktop. I'm having some issues however with my css. I'm working directly out of the dropbox folder using sass and compiling with node/gulp-sass to a normal styles.css file. When I use: // main.php <link rel="stylesheet" type="text/css" href="<?php echo $assets . '/css/styles.css' ?>" /> // outputs <link rel="stylesheet" type="text/css" href="/site/templates/assets/css/styles.css" /> ...any changes I make to my sass (even changes directly to styles.css) are not reflected on the page. However: // main.php <link rel="stylesheet" type="text/css" href="<?php echo $assets . '/css/styles.css?a=1' ?>" /> // outputs <link rel="stylesheet" type="text/css" href="/site/templates/assets/css/styles.css?a=1" /> ...works as intended with any changes I make visible immediately. It's obviously a caching thing but template caching is all disabled. I'm not sure where this is being cached? If the system is not outputting "/site/templates/assets/css/styles.css", then where is it getting the css from? Is it in the database? If I actually delete the styles.css file, the file is still there and populated in 'view source'. I thought maybe it's a dropbox thing (maybe this file is cached in dropbox) but I'm not sure. I also don't know how to clear the css cache in processwire (or set it to off). Of course I can just leave it as "/site/templates/assets/css/styles.css?a=1" but I'm intrigued. Any help is appreciated. Thanks. Link to comment Share on other sites More sharing options...
Sergio Posted October 26, 2016 Share Posted October 26, 2016 Hi SamC, Processwire does not create a CSS cache. This is done by your browser and/or the server (in this case, Dropbox). The technique you used to see the new file, by appending a query string in the filename, in this case "?a=1", is one of the things that trigger an instruction in the browser to make it download the file again. You can read more about this in this post https://css-tricks.com/strategies-for-cache-busting-css/ And regarding keeping the site copies in sync between your computers, although Dropbox works, it's not a good practice because you can't track changes on the files and risk losing some of the work done in eventually sync error. It is recommended that you use a version control system for this. Best, Sergio 2 Link to comment Share on other sites More sharing options...
SamC Posted October 26, 2016 Author Share Posted October 26, 2016 1 hour ago, Sérgio said: Hi SamC, Processwire does not create a CSS cache. This is done by your browser and/or the server (in this case, Dropbox). The technique you used to see the new file, by appending a query string in the filename, in this case "?a=1", is one of the things that trigger an instruction in the browser to make it download the file again. You can read more about this in this post https://css-tricks.com/strategies-for-cache-busting-css/ And regarding keeping the site copies in sync between your computers, although Dropbox works, it's not a good practice because you can't track changes on the files and risk losing some of the work done in eventually sync error. It is recommended that you use a version control system for this. Best, Sergio Hi @Sérgio thanks for the info, that link will come in handy no doubt. I haven't got the hang of version control yet. Got git installed but yet to follow any guides to use it effectively, seems quite confusing to me. I guess the next logical step would be to learn it. Link to comment Share on other sites More sharing options...
Sergio Posted October 26, 2016 Share Posted October 26, 2016 "To master git, one has to live many lives" – Confucius Is indeed very hard to understand it beyond the basics. I sure don't. One good resource that I can recommend is this course by Jeffrey Way on his Laracasts: https://laracasts.com/series/git-me-some-version-control He is an excellent teacher, I can't recommend him enough. Take a look at all courses there, you won't regret. 3 Link to comment Share on other sites More sharing options...
SamC Posted October 26, 2016 Author Share Posted October 26, 2016 Lol. I'll check it out thanks! (adds to #916 on the impossibly long web dev bucket list)... Link to comment Share on other sites More sharing options...
Aslom Posted October 27, 2016 Share Posted October 27, 2016 Guys tell me, could CSS caching do not work due to the fact that I use my local proxy provider? I need it to work, otherwise I can not work. Link to comment Share on other sites More sharing options...
szabesz Posted October 27, 2016 Share Posted October 27, 2016 On 10/26/2016 at 2:32 PM, SamC said: Lol. I'll check it out thanks! (adds to #916 on the impossibly long web dev bucket list)... I do not know about the Laracast tutorial, but this is my favorite: https://www.pluralsight.com/courses/using-git-with-gui Super cool, "boring off-topic stuff" is NOT included, easy to grasp via the usage of GUI, highly recommended Link to comment Share on other sites More sharing options...
FrancisChung Posted October 27, 2016 Share Posted October 27, 2016 +1 for Sourcetree too. Great tool if slightly confusing at the beginning. I probably need to look at this tutorial myself as some of the GIT Terminology confuses me. I'm always under the impression Push / Pull / Get Requests etc seem to have slightly different meaning to what I know them to be from using much older SCCs. 1 important gotcha of the Sourcetree tool is that you can't do merges of 2 branches with it (At least I haven't figured it out). So it appears me to that certain "admin" tasks can only been done online using the web client. 1 Link to comment Share on other sites More sharing options...
szabesz Posted October 28, 2016 Share Posted October 28, 2016 5 hours ago, FrancisChung said: you can't do merges of 2 branches with it I'm just a basic git user, so probably I just do not understand what you exactly mean? I has a nice Merge button... https://blog.sourcetreeapp.com/2012/08/21/merge-or-rebase/ 1 Link to comment Share on other sites More sharing options...
SamC Posted October 30, 2016 Author Share Posted October 30, 2016 On 10/28/2016 at 5:45 AM, szabesz said: I'm just a basic git user, so probably I just do not understand what you exactly mean? I has a nice Merge button... https://blog.sourcetreeapp.com/2012/08/21/merge-or-rebase/ Thanks 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now