CSS - why my browsers can't reflect any changes made on the server? - html

I was working on some CSS code and then suddenly the server stopped reflecting any changed made on the server. At first I thought it was a caching problem but I disabled caching on my browser and even tried using different browsers but still it's using the old version of my CSS file.
If I download my CSS file from the server and open in the text editor, it shows all the changes I made to the code but they don't reflect on my website at all. The site is using old version of the CSS file that doesn't even exist anymore on the server.
What on Earth is happening with my server? Can it be a router caching problem?

I can't answer this but try to add in your html, where you include the css this: ?v1.
Example: src="resources/yourDir/style.css?v1"
This will force everything to download the new css.
You can add after the ? everything you want. Like a timestamp, just a number or words. Whatever you like.

Related

CSS not updating on change

When I try and change my current CSS or add new CSS to my style-sheet no change shows up (tags are still being styled by the old unchanged code).
For example, if I delete the contents of a class and I go into chrome debug tool using F12, I can see that the contents which I deleted are still showing up - even if I clear the cache by pressing Ctrl+Shift+R, OR by pressing Ctrl+F5!
All the other files of my website seem to be updating correctly, so if I use inline styles it will update correctly.
Strangely when I go into my websites control panel and manually download the CSS style-sheet from my server I can see that the code has indeed being updated with the new code, this is weird because upon inspecting it with F12, I can still see the old code with no changes.
I am using Microsoft Webmatrix to do my coding.
I am using the Chrome Web browser.
I am using Hostgator hosting.
I've exhausted all my trouble shooting options and have been beat by something that by all means should not occur. I think I've had a problem like this before and I think that it was solved by just waiting a day for whatever magic to work but I shouldn't have to wait. A problem like this is absolutely unacceptable in a live environment. Any ideas of what could be causing this?
FIXED!
changed: https://example.com/app/source/css/main.css
to this: https://example.com/app/source/css/main.css?v=1
You could try ctrl + shift + r (on a PC) to hard reset the browser and make sure the cache isn't displaying old CSS.
One thing is to verify you are editing the correct file. I managed to have that issue one time when I had two files named the same, but one was outside the folder with the index.html and that was the one I was editing.
Add ?v=1 behind the URL of the CSS link in the head, which will force using a non-cached version, because of the different (new) file name. The number should be unique, so if you want to use this in the future, make sure to replace the 1.

CSS never loads. Impossible to edit my site. Cache?

Someone please explain this to me. I'm going crazy. I have a wordpress site and i can never make changes and simply see them in a browser.
So i get that i have to clear all caches etc etc etc. I do so and here are the scenarios:
a) i have w3 cache installed and then my website loads with no css.
b) i disable w3 cache but my website shows up with old css changes. I've added a whole bunch of .xxxxxxx { padding-right: xxpx;} things and they don't appear. But it is only the current changes that i'm in putting that are not showing up. i have a whole bunch of edits taht are showing up. So it must be some kind of cache!!!!##!##!##
I'm going nuts here. About to throw my computer out the window. Is there a way to just disable all caching or something of this nature until i'm done editing the website.
nhchat.com
I think your theme doesn't have support for w3 total cache. Just go into minification and select minification only (dont use "combine"). If the theme isn't built properly then it overrides the order that the files are loaded in. Secondly make sure that you edit the actual files (that are inside your theme directory) and not the cached ones.
Another thing to look into is the file permissions, right now the files cannot be accessed on your server. So make sure when you goto the address of your cached files, you should see a minified version of the files (right click > view source)
http://nhchat.com/wp-content/cache/minify/000000/dZFNjsIwDIUvRAisuMTsOEBkHNPxTH6q2FD19uO2g0pVsYvf--xnOWffCJIjUVByiUW5dG7SdCzghj55ECEVjyL-3mpRKvFw9l8wUrsmjtT81Mw4E2mSZZYNQsMB1d1ry-7iuWB6RFpmiY6J5HDyt8axo6VeyznO2h0MJDXvhWPmssUpUQcGsMX-z99DS-w3ke69DBhWf-sNdPtl_WjPeoh2s8y4tRpJbwvx89M2r7awkna7HwlYc1_FDvz2BW_ydhQ-RGsO9vwD.css

My CSS file is not saving

I'm working on a web page project, with an HTML file and a CSS file only. I use Sublime Text 3 for a better programming environment, I also use XAMPP to debug my code and test it on Chrome.
When I'm saving my programming files, the HTML one is saving, but CSS one is not saving; I checked it in the directory and opened it to view if my editions are saved or no, they are, but they don't show up in the debug using XAMPP and Chrome.
Why aren't my changes showing up in debug?
Try deleting the Chrome Browser's Cache. It might be creating that problem
It doesn't let me comment, but this is adding onto the users answer of clearing the browser cache.
Clear browser cache in chrome: https://support.google.com/accounts/answer/32050?hl=en&co=GENIE.Platform%3DDesktop
If the issue resolves after clearing your browsing cache, what I usually do when working with stylesheets is use the Chrome browser in incognito mode, it usually doesn't store cache in that mode, so after closing the tab and revisiting, it should show all of the changes.
fisrt try to clear/delete your browsers cache and if that didnt work try the steps below.
Lets say all your css code is in a file called style.css, what you need to do is:
you can just change the name of your file to something else for example style2.css (dont forget to also change the name in html file)
or
create a new file for example new-style.css.
copy and paste all the css code that you have from style.css to
new-style.css.
and lastly just delete style.css.
after that you can rename new-style.css back to style.css Or you can
keep it like that. doesnt really matter as long as you remember to
change the link name in html as well.
It might not be the best way to solve this problem but it works.

Chrome inspector doesn't show css line number anymore in many of the localhost sites

Every other website I visit, the inspector works as expected:
But in many of the sites I'm editing within apache server (using xampp) somehow they doesn't show the "filename.css:lineNumber" data
Also, every change I try to do in the inspector in thse sites, doesn't do anything to the code shown in the source tab.
I've tried refreshing, hard refreshing with cache, closing and opening the tab, closing and opening chrome again. The same problem occurs.
In other sites the inspector works well, but not in many of the localhost sites.
Has someone experienced this before? Is there a way to fix this?
If you are using a client-side CSS generator library such as Lea Verou's excellent -prefix-free or client-side Less, you will not see source information as it has all been processed and reinjected as style elements.
Client-side Less has a property [dumpLineNumbers] to include source line info as a comment in the generated source. (I'm not sure if this will display in Chrome's inspector - but I think it might)
The only "fix" I know of for -prefix-free is to temporarily remove it, obtain the source info for reference, then put it back in.
I have had the exact same problem (not using a css generator), and it appears to be a known bug with the current version of Chrome, the solution is to use the more up to date Beta version known as Chrome Canary - Here's the link :)
https://www.google.co.uk/intl/en/chrome/browser/canary.html
Try to check what the format of your CSS file is. I had the same trouble with the UNIX and Macintosh formats. For example, try to open you CSS file in Notepad++ and in the bottom right corner of the window you'll see your current format. If you see UNIX or Macintosh there, click it with the right button of your mouse and change to DOS/Windows. Then save your file and refresh your page in Chrome. It definitely helped in my case.enter image description here

CSS changes are not reflected in Joomla website

I have a site built around Joomla, It was working fine from the time it was built. But from few days back the css changes in any of the css files are not reflecting in the site. I am able to see all the other UI changes except CSS. I have cleared he cache and checked from different ISP but no result. Can anyone suggest me how to resolve this.
Thanks in advance.
I think you are using a Template which uses LESS instead of CSS. If so, see if there are any folder inside "/public_html/templates/your_template/less/" exists or not.
If it exists then you have to create (if it is already not there) a css file named "custom.css"
inside "/public_html/templates/your_template/css/" folder and write your CSS code inside this file.
Joomla will pickup this "custom.css" file at last and your changes will be reflected.
Sorry for late reply but I found the answer. It is due to enabling CloudFlare in my hosting account. When I reached to my Hosting support they disabled the CloudFlare and everything started working fine and I am able to see all the CSS changes.