Ver Mensaje Individual
  #6 (permalink)  
Antiguo 02/06/2011, 14:43
Avatar de Naahuel
Naahuel
 
Fecha de Ingreso: marzo-2011
Ubicación: localhost
Mensajes: 796
Antigüedad: 13 años, 1 mes
Puntos: 192
Respuesta: Comprimir css desde php

Si, entiendo.
Bueno este es el script completo y comentado:
Código PHP:
Ver original
  1. <?php
  2.  
  3.    // initialize ob_gzhandler function to send and compress data
  4.    ob_start ("ob_gzhandler");
  5.  
  6.    // send the requisite header information and character set
  7.    header ("content-type: text/css; charset: UTF-8");
  8.  
  9.    // check cached credentials and reprocess accordingly
  10.    header ("cache-control: must-revalidate");
  11.  
  12.    // set variable for duration of cached content
  13.    $offset = 60 * 60;
  14.  
  15.    // set variable specifying format of expiration header
  16.    $expire = "expires: " . gmdate ("D, d M Y H:i:s", time() + $offset) . " GMT";
  17.  
  18.    // send cache expiration header to the client broswer
  19.    header ($expire);
  20.  
  21. ?>

Intentá esto:

Código PHP:
Ver original
  1. <?php
  2.  
  3.    // initialize ob_gzhandler function to send and compress data
  4.    ob_start ("ob_gzhandler");
  5.  
  6.    // send the requisite header information and character set
  7.    header ("content-type: text/css; charset: UTF-8");
  8.  
  9. ?>
__________________
nahueljose.com.ar