CSS/JS Uploading Issues

Status
Not open for further replies.

staffing

New Member
Messages
18
Reaction score
0
Points
1
It has come to my attention that when uploading CSS/JS Files whether through an Uploader like FileZilla or DreamWeaver, the .css and .js files take a long time to update before taking effect on your website as opposed to .php/.html/etc.. files. This problem still persists when using the cPanel uploader. Is there any reason for this? It appears that I haven't been the only person with this problem. I view my websites css and it appears to be using an old version of the css whereas I look at the upload manager code and it show's the code that I have changed...

So why does it take a while before css and js files upload may I ask
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
I don't think this is to do with uploading, it's more of to do with caching; the same issue I'm having.
 

staffing

New Member
Messages
18
Reaction score
0
Points
1
I don't think this is to do with uploading, it's more of to do with caching; the same issue I'm having.
I do a force cache clear to refresh my website (CTRL + F5) in order to avoid that however there's still no effect
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi,

Please could you try appending this line to your .htaccess file and try again?
Code:
Header set Cache-Control "max-age=0, private, no-cache, no-store, must-revalidate"

Thank you,
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
I do a force cache clear to refresh my website (CTRL + F5) in order to avoid that however there's still no effect
This seems to do with Varnish cache (according to a Cloudflare staff member), so local cache wipes are nothing.
I've confirmed this by using multiple devices.
 

staffing

New Member
Messages
18
Reaction score
0
Points
1
Hi,

Please could you try appending this line to your .htaccess file and try again?
Code:
Header set Cache-Control "max-age=0, private, no-cache, no-store, must-revalidate"

Thank you,
This didn't work unfortunately.
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
From my experience, it takes a few minutes for it to update (can range from 5 to 1 hour).
Also, I've tried that header before and it has no effect on this issue.

Have you recently added an add-on domain? If so then when? Are you using Cloudflare? If you haven't used an add-on domain, when have you registered your account?
 

kabasspc

New Member
Messages
1
Reaction score
0
Points
1
I have fixed this issue by opening each folder directly and checking the files, through the browser. for example (test.pcriot.com/css/)
 

marc2002

New Member
Messages
5
Reaction score
1
Points
3
I had this same issue and after a bit of searching, this is what i've added to my .htaccess file.

Code:
<FilesMatch "\.(css|js|php)$">
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</FilesMatch>

Now i see my css/js updates instantly.

Edit: I should add that I don't use cloudflare. But I was affected by the varnish server when I first joined and it took me awhile to figure it out.
 

webbrewe

Member
Messages
58
Reaction score
3
Points
8
The above .htaccess solution from Dead-i doesn't seem to work. Try adding this:
ExpiresActive On
ExpiresDefault A1
Header append Cache-Control must-revalidate
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
@marc2002's solution seemed to have worked well! I had to do a bit of a clean up to avoid some bits of the code from getting overrided.
 

staffing

New Member
Messages
18
Reaction score
0
Points
1
I had this same issue and after a bit of searching, this is what i've added to my .htaccess file.

Code:
<FilesMatch "\.(css|js|php)$">
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</FilesMatch>

Now i see my css/js updates instantly.

Edit: I should add that I don't use cloudflare. But I was affected by the varnish server when I first joined and it took me awhile to figure it out.
Your solution worked marvelously! Thank you! :)
 

leafypiggy

Manager of Pens and Office Supplies
Staff member
Messages
3,819
Reaction score
163
Points
63
In reality, only the Cache-Control header is necessary to stop the caching. Trust us--we've been using it for months...
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
In reality, only the Cache-Control header is necessary to stop the caching. Trust us--we've been using it for months...
That alone didn't work though. Differs to others?
EDIT: That was a quick response.
From what I know, this issue occurs when you create a new account or when you add on a new add-on domain. Could need a bit of investigation.
Would be awesome if you guys who had worked around this issue could provide when you've registered and when you've added a domain (last one is for when the issue occurred after adding a domain).
 
Last edited:
Status
Not open for further replies.
Top