Subject: | documentation sug - Referer |
Under oddities, you say that sometimes it appears that the caching doesn't work because of the Referer. But you don't say how to fix it.
Looking at the WWW:Mechanize code, I found it was tracking my last_uri and was only really using that to establish the Referer. So I found that if after every "get," I did a
delete $mechObj{'last_uri'};
It cleaned the Referer out of the GET header, and the caching worked. It might be worth mentioning that it the docs.
I have also speculated that instead of deleting 'last_uri', I _MIGHT_ be able to do a get with:
$mechObj->get($uriToGet, 'Referer' => undef);
or maybe '' instead of undef. I'll try and test that in the next week.
I don't know if there's some value to keeping the referer, though both of these methods could be used to explicitly set it instead of delete it. But this addresses the Referer issue you brought up in Oddities.
-Steve
PS I'd also like to be able to explicitly set the expire time on a per-get basis, but I'll try and code that up and submit it later. I had a hack for that in 1.26, but I need to rework it a little and cleean it up in 1.30. It basically came down to overloading the get and intercepting the additional optional parameter. But I think I can do it cleaner than I did the first time.