Refreshing GWT application on client's side

前端 未结 2 1628
庸人自扰
庸人自扰 2021-02-05 19:53

I have written application using GWT. It works perfectly for the client. But when I\'m changing something in my application, recompiling and then deploying to the server and cli

2条回答
  •  滥情空心
    2021-02-05 20:18

    Make sure, that your "*.nocache.*" files and your start page (usually "index.html") are served with the correct HTTP caching headers. See Ideal HTTP cache control headers for different types of resources for a discussion on this (somewhat difficult) topic. Basically, you'll probably want to set

    Cache-Control: no-cache
    

    for these files. (By the way, this forces a re-download only when the file has changed!)

    How to do this configuration, depends on your web server (for Apache Httpd, you can use this guide).

    Alternatively - if you use a JavaEE server (Tomcat, Jetty, ...) to serve these files - you can use a Servlet Filter. Maybe you'd like to use my example from How to set Expires HTTP header on a single JS file in Apache Tomcat?

提交回复
热议问题