OpenGrok home page not refreshing when index updated

1.8k Views Asked by At

I followed this tutorial to install OpenGrok on an Ubuntu server using Tomcat 7. I have created a cron job that will trigger OpenGrok to update its indexes overnight.

If I browse my source tree, by visiting http://mysite/opengrok/xref/, the contents displayed are up-to-date. So the indexing clearly worked. But if I visit the home page, the contents are out-dated. The list of projects is not correct and the footer displays:

Indexes created XXXX

where "XXXX" is a date from several weeks ago. Ctrl-F5 does not help.

Some experimentation has determined that if I restart Tomcat, the home-page is updated. But this seems like a rather heavy-handed workaround. Is there another way I can force the home page to be updated?

Someone advised me to check the cacheTTL value in my web.xml, but it wasn't specified which apparently means the default is 5 seconds (source).

Any suggestions?

1

There are 1 best solutions below

4
On

I have few suggestions about debugging this problem

  1. This might be related to browser caching did you try viewing the page with other browsers?
  2. Tomcat might be caching the page.
  3. Tomcat reloads the app when it restarts. But you can reload the app easily without hassle by defining the resources you would like to be reloaded as WatchedResource as illustrated below.

    <Host>
    <Context ... reloadable="true">
     <WatchedResource>path/to/watched/resource</WatchedResource>
     <WatchedResource>another/path/to/another/resource</WatchedResource>
    </Context>
    </Host>
    
    • This way Catalina can also watch the requested files in addition to it's classes/libraries/configuration files and reload the resource. But, I would suggest using Tcat for such operations.

Let me know if you make any progress.