[freeside] Page refreshing

ivan ivan at 420.am
Sun Dec 3 02:13:11 PST 2000


On Sat, Dec 02, 2000 at 07:44:16PM -0800, Jason Spence wrote:
> On Fri, Dec 01, 2000 at 04:11:49PM -0800, Kristian Hoffmann developed
> a new theory of relativity and: 
> 
> > Make sure the time on your windows machine is close (within a few
> > seconds) to your machine running freeside.  "now" is relative to what
> > machine you're on.  Failing that, you can add the
> > "Cache-Control: No-Cache" header to all of the pages.  That seemed to
> > help and will also tell proxies not to cache the pages locally.

Hmm... interesting.  How does that compare to "Pragma: no-cache" which is
added by CGI.pm?  (look arount line 1261 or so).  Certainly can't hurt to
add it if helps.

> On this note, we've been having issues with people behind a Novell
> BorderManager firewall/NAT box access Freeside, since BorderManager
> has some weird cache which (as far as I can tell) turns on randomly
> and causes all sorts of havoc with Freeside.
> 
> We're going to install squid at the site we've deployed Freeside at
> soon, so I think it's time that Freeside learned how to deal with
> caches.

I'm pretty sure Freeside deals okay with well-behaved caches.  I run squid
myself.

>  We're already halfway there with the FS::CGI module, I would
> think.

Unfortunately not - FS::CGI isn't a subclass of CGI.pm - but see below.

>  I'd write a patch, but I already have (I think) three ones
> floating in Ivan's queue and I haven't received any response on those
> yet, so...

I know, I'm really behind, I'm sorry and I'll do my best to catch up.

Also, are the folks with pending patches (that would be you, Jason, and
also Kristian and Jeff F.?) CVS capable?  I'll still be a bit of a
dictator and ask that the big changes be checked in as branches, not on
the trunk right away, but no reason for you folks not to be able to check
in bugfix-type stuff on the trunk.  And stuff on branches is a lot easier
to work with than patches.  :)  If you're amenable to using CVS, let me
know and I'll setup accounts. 

> Kristian, it sounds like you've already tried this.  Do you have a
> patch for the CGI.pm file that changes the headers?  

Hmm, it does seem like CGI.pm is the right place for it, but even if it
got changed today, CGI.pm has been distrbuted with Perl for ages.  Have to
live with it for now.  Until then:

    package FS::CGIwrapper;
    use vars qw(@ISA);
    use CGI;
    @ISA = qw(CGI);
    sub header { shift->SUPER::HEADER( @_, '-Cache-Control' => 'No-Cache' );

then s/use CGI;/use FS::CGIwrapper/ and s/new CGI/new FS::CGIwrapper/; in
htdocs/*

should do it.  I checked in a (slightly cleaner) CGIwrapper.pm, but didn't
yet make the changes in htdocs/ - if one of you guys wants to test it out
before I do that (or you do it, heheh!) that would be great.

> Actually, I just had a thought: the "browse customers by customer
> number" page is pretty beefy,

Oh, not worth it; the idea is wrong for a large install.  Browsers just
have problems with large documents like that.

For a large install, I'd say just skip having that as an option at all -
it'll just suck up absurd amounts of system resources.  Have people use
the fuzzy search.  It'll suck resources too, but it won't crash browsers
as much.  :)

> and it would probably be a good thing to
> have search/cust_main.cgi say that its output is cacheable if
> 
> 1) it's running under mod_perl and 
> 
> 2) it sees that it's about to run a query on cust_main, and cust_main
>    hasn't changed lately (but how to check this?)
> 
>  - Jason

-- 
meow
_ivan



More information about the freeside-users mailing list