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

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

问题描述

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

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

我真的很希望你能帮我解决这个问题.我现在正试图解决这个问题超过 10 个小时.:/

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

所以我正在使用我的 ftp 帐户更新和删除一些文件(jpg、css、js 和 ico).
文件上传后,我使用我的 ftp 帐户再次下载.因此,我可以确认文件已正确上传.
但是现在出现了奇怪的事情:我启动了一台计算机(不同的 IP,从未访问过我的网站).我清理了设备上浏览器的缓存 2 次以防万一...
然后我访问了该网站,并且 css/js/jpg/ico 文件没有更新.即使我通过在地址栏中直接输入他们的地址来访问他们也不会.
然后我在另外 2 个不同的设备上尝试了它.没有成功.
所以我回到我的主计算机并使用我的 ftp 登录下载文件,是的,这些文件是 up2date.我等了一天多才让我的网站图标正确显示.但它仍然是最初的 Joomla 图标.

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.

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

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.

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

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


它变得更好了.我必须在 2 天前做的一些更改才刚刚申请!我的网站基本上是他妈的.-.- 当我没有意识到它没有更新它们并且我在那里犯了很多错误时,我试图改变很多东西.现在我不能把它改回来……我不知道那里到底发生了什么.


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.

我认为这与 .htaccess 无关.在我开始使用它之前,我遇到了这些问题.

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

另一个
它只是自己变回来了...我不喜欢 Joomla.-.-

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

再次
关于最后一次原来我只是在输入 www.而不是 http://
oO 这怎么可能.为什么不同的 css 会应用www."?

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."?

推荐答案

如果您重命名您的 .htaccess 文件是否可以正确下载?

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

这应该是一个缓存问题(服务器可以在它所服务的文件上设置一个过期"时间,这样浏览器就不会检查修改;它也可以自己缓存文件).这很可能是在 .htaccess 或 httpd.conf 中完成的.

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.

如果你不能用.htaccess解决,不用浪费时间,就用不同的名字上传新文件(在名字icon-2.png中添加版本)

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)

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

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

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

或在 httpd.conf(这是主要的 apache 配置,通常由您的提供商托管):

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>

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

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=

因此,如果 - 正如我从您的最新评论中收集到的 - 它存在于您的 httpd.conf 中,您仍然应该能够在 .htaccess 中覆盖它.

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天全站免登陆