Joomla / FTP:通过FTP更新的文件不会在浏览器中更新 [英] Joomla/FTP: Files updated via ftp won't update in browser

查看:390
本文介绍了Joomla / FTP:通过FTP更新的文件不会在浏览器中更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,这与浏览器缓存无关,我对此100%确定。



我真的很希望你能帮助我。我试图解决这个超过10个小时现在。 :/ b /

因此,我正在使用我的ftp帐户更新和删除一些文件(jpg,css,js和ico)。

文件上传,我再次使用我的FTP帐户下载他们。所以,我可以确认文件上传正确。

但现在来了奇怪的事情:我启动一台电脑(不同的IP,从来没有访问过我的网站)。我清理设备上的浏览器缓存2次,以防万一...

然后我访问的网站和CSS / js / jpg / ico文件没有更新。即使我通过直接在地址栏中输入他们的地址访问它们。

然后,我尝试了其他2个不同的设备。没有成功。

所以我回到我的主电脑,并使用我的FTP登录下载文件,是的文件是up2date。我等了一天以上,我的图标显示正确。但它仍然是原来的Joomla图标。

现在您可能认为我使用了错误的ftp帐户,但是我注意到一些非常奇怪的事情。当我点击在Firefox的显示源代码,然后点击链接的CSS文件在出现的窗口中显示旧文件(如预期的..),但按F5后,它实际上显示正确的。当我现在回到浏览器并再次键入我的网站的地址时,新的CSS实际上被应用。当我重新加载它时,一切都回到了旧的。

上载之前不存在的新文件完全没有问题。他们是immidiately可用。



我想这与我的Joomla有关! (3.1.5)或我的主机(lima-city.de)。 :/ b /

编辑:

它变得更好了。
我可能在2天前做过的一些事情只是申请!我的网站基本上是fed。 - 当我没有意识到它没有更新它们时,我试图把许多事情都揪出来,我在那里犯了很多错误。而现在我不能改变它...我不知道那里到底是怎么回事。

我不认为这与.htaccess有关。我有这些问题之前,我开始使用它。



另一个编辑:

它只是自己改变。 ..我不喜欢Joomla。

再次编辑:

关于上次编辑:原来我只是输入www。而不是http://

oO怎么可能呢?为什么不同的css获得www的应用?

解决方案

如果你重命名.htaccess文件是否正确下载?它应该是一个缓存问题(服务器可以在它所服务的文件上放置一个过期时间,以便浏览器不会检查修改;它也可以缓存文件本身)。这很容易在.htaccess或httpd.conf中完成。

如果使用.htaccess无法解决问题,不会浪费更多时间,只需上传新的文件在不同的名称(添加版本的名称icon-2.png)

更新:
过期标头位于.htaccess中:

p>

 < IfModule mod_expires.c> 
ExpiresDefaultaccess plus 1 month

或在httpd.conf中(这是主要的apache配置,通常由您的提供者托管):
$ b $ pre $ LoadModule expires_module /usr/lib/apache2/modules/mod_expires.so $ (

ExpiresDefaultaccess plus 3 days
< / filesMatch>

为了确定是否存在长期到期,只需打开Firebug - Net面板,重新加载页面你应该能够快速地发现 Cache-Control max-age =

First of all, this has nothing to do with the browsers cache, I'm 100% sure about it.

I really really hope you can help me with that. I'm trying to fix this for more than 10 flat hours now. :/

So I was updating and deleting some files (jpg,css,js and ico) using my ftp account.
After the files were uploaded, I downloaded them again using my ftp account. So, I can confirm the files were uploaded correctly.
But now comes the weird thing: I start a computer (different ip, never visited my website). I cleaned the cache of the browser on the device 2 times just in case...
Then I visit the website and the css/js/jpg/ico files were not updated. Not even if I access them by directly typing their addresses in the addressbar.
Then I tried it on 2 other different devices. No success.
So I went back to my main computer and downloaded the files using my ftp login and yes the files were up2date. I waited more than a day for my favicon to show up correctly. But it's still the original Joomla icon.

Now you might think that I used a wrong ftp account, but I notices something very very weird. When I click show sourcecode in Firefox and then click on the "link" to the css file in the appearing window it shows the old file (as expected..), but after pressing F5 it actually shows the correct one. When I now go back to the browser and type the address of my website again the new css is actually applied. When I reload it anothertime everything goes back to the old one though.

Uploading new files that didn't exist before are no problem at all btw. They are immidiately available.

I guess this has something to do with either my Joomla! (3.1.5) or my hoster (lima-city.de). :/

Edit:
It's getting even better. Some cahnges I must have made maybe 2 days ago did just apply! My site is basically f**ked. -.- I tried to cahnge soooo many things back when I didn'T realize that it wasyn't updating them and I made a lot of mistakes there. And now I can't change it back... I have no idea what the heck is going on there.

I don't think that this is related to the .htaccess. I had these issues before Is I started using it.

Another edit:
It just changed back by itself... I dont like Joomla. -.-

edit again:
About the last edit: It turned out that I was just typing www. instead of http://
oO how is that even possible. Why does different css get applied with "www."?

解决方案

If you rename your .htaccess do the files download correctly?

It should be a cache issue (the server can put an "expire" time on the files it serves so the browser won't check for modifications; also it can cache files itself). This was done in the .htaccess or in the httpd.conf most likely.

If you can't solve it with .htaccess, without wasting more time, just upload new files under a different name (add version to the name icon-2.png)

Update: The expires headers are located either in .htaccess:

<IfModule mod_expires.c>
ExpiresDefault                          "access plus 1 month"

or in the httpd.conf (which is the main apache configuration, usually hosted by your provider):

LoadModule expires_module /usr/lib/apache2/modules/mod_expires.so
ExpiresActive On

<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
ExpiresDefault "access plus 3 days"
</filesMatch>

In order to determine if a long expiration is present, just open Firebug - Net panel, reload the page and you should be able to quickly spot the Cache-Control max-age=

So if - as I gather from your latest comment - it is present in your httpd.conf, you still should be able to override it in the .htaccess.

这篇关于Joomla / FTP:通过FTP更新的文件不会在浏览器中更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆