Re: [htmltmpl] inconsistent file_cache behavior
Brought to you by:
samtregar
From: Mathew R. <mat...@re...> - 2004-05-17 04:08:55
|
> Sam Tregar wrote: > > On Sun, 16 May 2004, Nishikant Kapoor wrote: > >=20 > >>Apparently, 'featuredLinks.cgi' is returning the template from the = cache > >>when I expect it to generate a new one. This is how I am calling the > >>template: > >> > >> my $tmpl =3D HTML::Template->new(filename =3D> $linksTmpl, > >> file_cache =3D> 1, > >> file_cache_dir =3D> 'tmplCache', > >> file_cache_dir_mode =3D> 0777); > >=20 > >=20 > > What do you mean by 'generate a new one'? Are you auto-generating > > your templates in some way? Usually templates are edited by hand = and > > the file_cache only refreshes when the mtime on the file changes due > > to an edit. >=20 > I meant that the template should get re-filled with default links when = I=20 > log out rather than returning customized links (which were displayed=20 > when I was logged in). >=20 > I do edit the template by hand but in this case, the mtime on the=20 > template is not changing. However, the content for the template needs = to=20 > change based on whether the user is logged-in or logged-out. This sounds like you are using H::T incorrectly... somewhere in you = template you should probably doing somthing like: <TMPL_IF logged_in> <TMPL_INCLUDE logged_in.tmpl> <TMPL_ELSE> <TMPL_INCLUDE default.tmpl> </TMPL_IF> You may need to put more information in the email, as it appears that = what you are trying to do, is reasonably simple thus you shouldn't = really be getting stuck. >=20 > >>Another issue, though not a big one. Even though I specify '0777' = for > >>creating file_cache_dir, I still get 'tmplCache' created with '0755' > >>permissions. > >=20 > >=20 > > Huh, that's odd. I'm passing that mode as the second arg to = mkdir(). > > That should work. Are you sure you didn't create the directory > > yourself? >=20 > Yep, I made sure of that by removing 'tmplCache' and letting H::T = create it. This could be related to your 'uname' mask - if it is set to '022' then = you have found your answer. Mathew |