shitou's blog 

  • Home
  • About
  • Feed
  • 十人族
  • MIX BOY
  • 塌客

Category "ruby on rails"

02
Oct

rails中javascript和css调入设置cache为true的问题

在rails中可以将调入的所有js文件和css分别封装在一个单独的文件中,这样做的好处就是减少HTTP请求的数量,加快下载速度和减轻服务器的多次建立链接的压力, 由于我的开发平台是在windows上的,设置

 

<%= javascript_include_tag 'prototype', 'effects', :cache => true %>

 

之后是没问题的,但是当放在服务器(Linux+Lighttpd)上之后, 运行(生产环境)就会抛出500的错误,后来通过把

 

config.action_controller.consider_all_requests_local = true

 

设置为true后,才发现原来是权限问题,rails首次运行时会在javascripts文件夹下建立all.js的文件, 我的Lighttpd运行属主为非root用户,所以默认是没有权利建立文件的, 所以需要把javascripts文件夹的权限设置为Lighttpd运行属主有可写的权利, 对应的如果设置了stylesheets的cache为true的话也要把stylesheets文件夹的权限调整为可写的, 当然这需要看你的服务器的运行所有者了,如果你是以root运行lighttpd的,那么就应该不会遇到这样的问题,但使用root运行服务是不安全的

 

Tags: cache

2008-10-02 12:19:17, 3182 reviews, comment

send to mailbox

Your email:

Related Posts

rails fragment cache(片段缓存)

TOP

Tags

json Impactjs Canvas fun gen_server superfly PS3 Webgame HTML5 jquery SSH tenerer MooseFS gearman-ruby Gearman MongoDB MochiChat TCP U-ka saegusa IN db command Mai Kuraki Norah Jones log iPhoneException ACG Mac Safari objective-c CouchDB LVS AJAX debian 推荐 AMQP google mail bug gettext Erlang 北京 iptables 架构 tips mysql backup function 我看 postfix 监控 SEO cache Etag memcache thread 进程 线程 无锡 yield file column mixboy xml rss gems ruby shitou shell lighttpd 安全 csrf 公司 nginx linux 模块 apache webserver 朋友 大学 生活 尼古拉斯凯奇 movie 文件同步 笑笑 歌词 auto complete plugin rails music ubuntu blog

Category

  • HTML5[3]
  • iPhone[17]
  • Erlang[11]
  • google[13]
  • 生活[45]
  • 音乐[13]
  • 电影[11]
  • linux[29]
  • web server[6]
  • mail server[3]
  • cluster[1]
  • system manage[9]
  • ruby[20]
  • ruby on rails[28]
  • 开源[4]

Episode

  • MongoDB
  • MochiChat
  • iPhoneException
  • shell
  • thread
  • memcache


Popular Posts

  • 准备开始学习Erlang了(恶狼, 二郎..)
  • Ruby遍历MemCached的key
  • 服务器监控小脚本
  • MySQL Innodb备份
  • [转载]5个有用的ruby gems

Recommended Posts

  • Tri-survive - HTML5 Game
  • Cut the rope - HTML5版
  • json_formatter
  • 在gen_server中spawn新的进程
  • Superfly - Wildflowers
  • 继续凸墙 for Mac OS
  • MongoDB Beijing 2011
  • MongoDB删除map_reduce生成的tmp collection
  • Mai Kuraki - Future Kiss
  • Erlang OOP
  • 用SSH tunnel凸墙
  • Google的语法高亮工具包
  • 大量数据的批量操作
  • 再次被和谐-_-
  • 十人族: 上线了

Friends' blogs

  • levy
  • sphance
  • andreas
  • yangkunlun
  • {:dev=>:wxianfeng}
  • bheye
  • joeydarko

Login

   注册

留言 查看留言

留言

   取消

留言 查看留言


Statistics

  • 访问次数: 316261
  • 今天访问: 56
  • 日志: 213
  • 评论: 4967
  • 音乐: 9
  • 用户: 1759


少女,不点下广告吗!

 

all by shitou

blog comments powered by Disqus

close