Quick links: Content - sections - sub sections
EN FR
Quick Search Advanced search
 
Page

  [Opened] How to redirect from a zone file?

Posted by tudorilisoi on 11/11/2009 09:36

Hi, I now, redirects should be handled in the controller. But what I'm trying to do is move almost all the sql inside the zone files in order to take advantage of zone caching and speed up the site. When performing the sql, it may turn out that an invalid http request parameter was passed, but I'm inside the zone, and need to throw a http 404 or 500 error Here's my hacky solution, can you advise a better one?

 
 $rep = $GLOBALS['gJCoord']->response;
 if ($invalid_params) {
 @ob_end_clean();
 $rep->setHttpStatus('404','not found');
 $rep->bodyTpl='404';
 $this->_cancelCache=true;
 return; 
 }

  [Opened] Re: How to redirect from a zone file?

Reply #1 Posted by laurentj on 11/12/2009 00:02

You mustn't manipulate request or responses in zones. Zone should only generate content for a part of your page. A zone corresponds to a part of your page, and could be reused in several actions if needed.

  [Opened] Re: How to redirect from a zone file?

Reply #2 Posted by laurentj on 11/14/2009 11:33

The version 1.2 will have a jCache object, with a plugin system to store the cache where you want. (it is already included in the nightlies)

 
Page
  1. Re: How to redirect from a zone file?