HTML Cache control meta tag

61 views
Skip to first unread message

Kris

unread,
Mar 11, 2013, 3:38:30 PM3/11/13
to he...@googlegroups.com
Is there a configuration option somewhere that can configure the Meta tag: CACHE-CONTROL?  or the PRAGMA:NO-CACHE?

I would like to turn caching off/keep the browser from caching static files.

Thanks,
Kris

si...@nekapuzer.at

unread,
Mar 12, 2013, 11:12:59 AM3/12/13
to he...@googlegroups.com
you want to disable caching for static files served with staticMountpoint?

I don't think there is a built in way. but you can overrule the whole jetty.xml configuration with the `-c` option:

java -jar launcher.jar -c jetty.xml

greetings
simon
> --
> You received this message because you are subscribed to the Google Groups "Helma" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to helma+un...@googlegroups.com.
> To post to this group, send email to he...@googlegroups.com.
> Visit this group at http://groups.google.com/group/helma?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Kris

unread,
Mar 12, 2013, 12:29:52 PM3/12/13
to he...@googlegroups.com
> I don't think there is a built in way. but you can overrule the whole jetty.xml configuration with the `-c` option: 

Thank you for responding!  I believe you are correct.  The option you describe above is very useful for defining Jetty server options (which I do use to configure SSL and other configuration options of the Jetty server) but the cache is controlled in the servlet method(s).

I did some research and finally found where Helma defines to Jetty the static directory.  Helma uses the Jetty standard servlet named "ResourceHandler" for static content in the Helma source file: ApplicationManager.java around line 519 (+/- since my version of Helma has other custom mods that were put in.)

ResourceHandler has a method "setCacheControl" that allows setting the cache configuration for every static item.  So adding the line like:

    rhandler.setCacheControl("no-cache,public");

Provided the solution I was looking for.  It would be nice if there was some more control over what is changed but the basic solution will work.

Again, thank you for responding,
Kris
Reply all
Reply to author
Forward
0 new messages