[solved] cache with url variables

Discussion in 'Install/Configuration' started by gdewey, Mar 31, 2013.

  1. gdewey

    gdewey Member

    I am doing some test with the cache functionality using a proxy context (call /api/) to a tomcat application.

    it seem like as long as I don't send any URL variables to the origin server the cache works perfect and expires as it should, but when I give the application any variable such as:

    http://192.168.120.48/api/api.cfm?name=Dewey

    it wont cache and will request new information all the time. I am just calling the variables via GET not POST. Is there a way to cache matching the url regardless the variables?

    tks
    Last edited by a moderator: Mar 31, 2013
  2. NiteWave

    NiteWave Administrator

    it should work as you expect. may relate to the cache policy you set.

    what's your cache policy ?
  3. gdewey

    gdewey Member

    the cache policy is at the context level. I am setting

    enable cache = yes
    cache expire time = 30 seconds
    cache stale age = 5 seconds

    virtual host and server are not set to anything.. only cache path is set to a directory. not sure if I am missing something..
  4. NiteWave

    NiteWave Administrator

    context level setting is ok, it'll override server/vhost level setting.

    cache policy refer following settings:
    Cache Request with Cookie
    Cache Response with Cookie
    Ignore Request Cache-Control
    Ignore Response Cache-Control
    Enable Private Cache

    hmm... it looks like missing one setting:
    Cache Request with Query String
    will report to development.

    as a workaround, please set vhost level
    Cache Request with Query String:Yes

    see if works.
  5. gdewey

    gdewey Member

    excellent, that was the setting I was looking for. as you mention is not present at context level, but it is at vh. Its working now as expected

    tks

Share This Page