Re: help with XML refresh and cache control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks. The browser in question is IE7, with its Temporary Internet Files setting set to "Automatically" (the default). Firefox has no problem geting it right.

The URL is always generic_xsl.rex. Only the CGI query information varies.

I tried adding to my config file:

<Files generic_xsl.rex>
	Header set Cache-Control no-cache
</Files>

and restarting the Apache service (and restarting the browser for luck), but it has no effect. I also tried using the exact path recorded in the log (/cgi-bin/generic_xsl.rex), but it didn't help.

The log shows access to specific.xsl, so I also tried that file name (with and without paths), but no joy.

I added quotes, but again it made no difference.

Does it matter where the <Files> section is located in httpd.conf? Do I need to enable any modules? (Apache 2.2 Windows binary).




Joshua Slive wrote:
On 7/24/07, Jim Owens <jowens@xxxxxxxx> wrote:
I'm using Apache on an intranet to serve an XML database. Users can
modify what they see by selecting radio buttons on an HTML form. The
form sends off a CGI GET request with different parameters, based on the
buttons selected -- for example, generic_xsl.rex?product=A&revision=B.
The script generates a customized XSLT file called "specific.xsl" and
then sends the XML file with an xsl:stylesheet header invoking specific.xsl.

On some browsers, successive different requests don't change the
display. The user has to hit Refresh to see the updated XSLT output.

That would be a significant browser bug if the cache is being used
when a different URL is specified.


To solve this, I've added to the Apache configuration:

header Cache-Control no-cache

This works, but has side effects. Now when the user returns to the HTML
form, the previously selected buttons are cleared.  Also, of course,
caching is completely disabled, which doesn't seem like good practice.

Is there a way I can use no-cache selectively -- say, only when the
script is invoked, or only when the referring page is the HTML form?
I'mn aware that Header has an env= option, but I can't figure out how to
use it here.

The header directive can be scoped inside
<Directory>/<Location>/<Files> sections. So for example,
<Files generic_xsl.rex>
Header set ...
</Files>

You could also try different cache-control directives like
must-revalidate to see if the effect was better.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux