本地服务器不反映更新的文件 [英] Local server not reflecting updated files

查看:94
本文介绍了本地服务器不反映更新的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在用户本地服务器上还很陌生.我正在使用http服务器,它是Node的软件包.我正在使用它来使用Phaser库来托管HTML5游戏.我拥有游戏中正在使用的图像资产,有时我会更新这些资产.当我这样做时,对图像的更改不会反映在游戏中.我尝试重新启动服务器,但这无济于事.他们通常需要一些时间才能更新,大概需要一个小时.任何想法出什么事了吗?

I'm fairly new at user local servers. I'm using the http-server which is a package from Node. I'm using it to host an HTML5 game using the Phaser library. I have image assets I'm using in the game, and I sometimes update these assets. When I do, the changes to the images aren't reflected in the game. I've tried restarting the server but that doesn't help. It usually takes some time for them to update, maybe about an hour. Any ideas what's going wrong?

推荐答案

浏览器可能正在缓存您的代码和/或资产.

The browser might be caching your code and/or assets.

在Chrome中,打开开发工具(右键单击->检查元素),您可以右键单击刷新按钮和清空缓存并重新加载".

In Chrome, with dev tools open (Right click -> Inspect element) you can right click on the refresh button and 'empty cache and hard reload'.

这篇关于本地服务器不反映更新的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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