7

I have uploaded the file.css file on server with filezilla and also with cpanel. But when i browse the website the css has no impact.

I changed: padding-left: 10px; If i see the Page view source i see that the older file is there.

What can be the reason for that ?

cola
  • 12,198
  • 36
  • 105
  • 165

7 Answers7

22

Try doing a hard refresh. CTRL Shift R. That should force any cached files to clear. Chances are that's the problem, unless the file isn't uploading. If you see the new file listed in Filezilla then it's a cache issue.

Adam
  • 558
  • 1
  • 6
  • 12
  • How can I do a hard refresh only for the file? I don't want to clear all the cached files, but only the the file that I am uploading. Any idea? – cawecoy May 28 '13 at 13:39
  • 1
    Thanks so much I can't believe I never knew this before, solves a lot of my problems – Brent Pappas Oct 25 '17 at 20:59
4

Have you checked the permission for css files?

It should be 644 for all files, and 755 for all folders.

AvidLearner
  • 4,123
  • 5
  • 35
  • 48
Nids Barthwal
  • 2,205
  • 20
  • 12
  • 2
    hey there. Some day you will have enough reputation to comment, and that will be great, but for now refrain from posting such answers which are not really answers: you are **asking** op about clarifications. – Félix Adriyel Gagnon-Grenier Jul 26 '15 at 14:20
3

Did you replace/overwrite the existing css file? It sounds like maybe the old one wasn't overwritten - in which case you'll have to do that for the changes to take effect.

Are you using a CMS? Some of them have Cache features where it may take time for those changes to be reflected unless you hard refresh.

Hanny
  • 2,078
  • 6
  • 24
  • 52
1

http://httpd.apache.org/docs/2.2/programs/htcacheclean.html

If you are using apache2 this is amazing, use the "-i" option, the reason the files dont update is because they are cached, if you cant do this you can always change the href="styles.css" into href="styles.css?v=version2" it makes the server think that there is a new file, so then it updates the cache

1

First try to clear the cache. If nothing happens then link your CSS like this:

<link rel="stylesheet" type="text/css" href="style.css?v=0.001">

It should help.

1

I changed the name of the .css file, deleted the old one from the server, reuploaded and directed the html to that newly named and uploaded css file. Worked like a charm for some reason.

Mwiti
  • 45
  • 6
0

If you are using nginx, you very likely have deleted the "include mime.types" directive from your nginx.conf file by mistake. So you should add it back(the code below was copied from Daniel Peterson):

http {
    include mime.types;
    ...

    server {
        listen: 80
        ...
    }

After editing the conf file and reload the nginx server, you may also want to clean the cache on your browser by pressing ctrl+f5.

vainquit
  • 491
  • 6
  • 13