[users@httpd] caching rails generated images

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I use Ruby on Rails to generate images, which are delivered via
mod_fastcgi to apache2.
These images should be cached using mod_cache and mod_disk_cache.
But it does not work.
In Rails I set my http headers like this:

      expires_in 30.hours, :private => false
      @response.headers['Last-Modified'] = im.serie.received
      @response.headers['Content-Length'] = data.size
      send_data data, :type =>  'image/png', :disposition => 'inline'

The important settings from apache2 conf look like this:


<IfModule mod_fastcgi.c>
  FastCgiServer /home/hmeyer/devel/dicomweb/public/dispatch.fcgi \
    -initial-env RAILS_ENV=development \
    -processes 5 \
    -idle-timeout 60
</IfModule>

<VirtualHost *>
   DocumentRoot /home/hmeyer/devel/dicomweb/public
   ErrorLog /home/hmeyer/devel/dicomweb/log/apache.log
   CustomLog       /home/hmeyer/devel/dicomweb/log/access.log combined
   SetEnv          RAILS_ENV development

        <IfModule mod_cache.c>
                <IfModule mod_disk_cache.c>
                        CacheRoot /var/www/cache/
                        CacheSize 256000
                        CacheEnable disk /image
                </IfModule>
                CacheDirLevels 5
                CacheDirLength 3
        </IfModule>

   <Directory /home/hmeyer/dicomweb/public/>
    Options ExecCGI FollowSymLinks
    AddHandler cgi-script .cgi
    AllowOverride all
    Order allow,deny
    Allow from all
    ExpiresByType image/png "now plus 1 month"
    ExpiresActive On
   </Directory>
</VirtualHost>


What am I doing wrong?

Thanx for your help!

Henning

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux