Changeset 2592


Ignore:
Timestamp:
Jan 9, 2012, 8:57:26 PM (8 years ago)
Author:
goya
Message:

Meilleure gestion du cache pour les images de circos et departements

Location:
cpc/trunk/project/apps/frontend/modules/circonscription
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/circonscription/actions/actions.class.php

    r1685 r2592  
    267267  }
    268268
    269   private static function echoDeptmtsImage($w, $h) {
     269  public static function echoDeptmtsImage($w, $h) {
    270270    $dom = self::generateSvgDep($w, $h);
    271271
     
    327327
    328328  /* $circo is a three digits string, or "full" for the full map */
    329   private static function echoCircoImage($circo, $w, $h)
     329  public static function echoCircoImage($circo, $w, $h)
    330330  {
    331331
     
    355355
    356356  public function executeGetDeptmtsimagepng(sfWebRequest $request) {
    357     $w = $request->getParameter('w');
    358     $h = $request->getParameter('h');
    359     header("Content-type: image/png");
    360     self::echoDeptmtsImage($w, $h);
    361     return sfView::NONE;
     357    $this->w = $request->getParameter('w');
     358    $this->h = $request->getParameter('h');
     359    $this->getResponse()->setHttpHeader('content-type', 'image/png');
     360    $this->setLayout(false);
     361    $this->getResponse()->setHttpHeader('Expires', 'Mon, 06 Jan 2042 00:00:00 GMT');
    362362  }
    363363
    364364  public function executeGetCircoimagepng(sfWebRequest $request)
    365365  {
    366     $circo = $request->getParameter('circo');
    367     $w = $request->getParameter('w');
    368     $h = $request->getParameter('h');
    369     header("Content-type: image/png");
    370     self::echoCircoImage($circo, $w, $h);
    371     return sfView::NONE;
     366    $this->circo = $request->getParameter('circo');
     367    $this->w = $request->getParameter('w');
     368    $this->h = $request->getParameter('h');
     369    $this->getResponse()->setHttpHeader('content-type', 'image/png');
     370    $this->setLayout(false);
     371    $this->getResponse()->setHttpHeader('Expires', 'Mon, 06 Jan 2042 00:00:00 GMT');
    372372  }
    373373
Note: See TracChangeset for help on using the changeset viewer.