How to write a channel.html file in Rails (for Facebook)

前端 未结 4 2055
醉梦人生
醉梦人生 2021-02-08 22:57

According to the FB SDK I must include a channel file with the appropriate headers.

Being a major NOOB and a Rails not PHP developer I have no idea how to do this.

4条回答
  •  死守一世寂寞
    2021-02-08 23:35

    Inside your controller:

    cache_expire = 1.year
    response.headers["Pragma"] = "public"
    response.headers["Cache-Control"] = "max-age=#{cache_expire.to_i}"
    response.headers["Expires"] = (Time.now + cache_expire).strftime("%d %m %Y %H:%I:%S %Z")
    render :layout => false, :inline => ""
    

提交回复
热议问题