Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8583307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:30:12+00:00 2026-06-11T21:30:12+00:00

according facebook’s Javascript SDK, facebook application should include Channel File on their init code.

  • 0

according facebook’s Javascript SDK, facebook application should include “Channel File” on their init code. as published here:
http://developers.facebook.com/docs/reference/javascript/

i didnt fully understand why they need that, or what should be the content of that file, but im just using their basic example as it may help in some specific issues.

my question is – they said that this ‘channel.html’ file should be cached. and even gave an example of how to cache it with PHP:

 <?php
 $cache_expire = 60*60*24*365;
 header("Pragma: public");
 header("Cache-Control: max-age=".$cache_expire);
 header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$cache_expire) . ' GMT');
 ?>

the thing is, AFAIK, that can’t be done with asp.net since, i cannot put c# code in html file.

so in the meanwhile i just add it hard-coded, like:

<head>
    <meta http-equiv="cache-control" content="max-age=31536000;public" />
    <meta http-equiv="expires" content="31536000" />  
</head>

im not sure that this is the right way to do it, since “expires” should be given in a specific format date.

any ideas how can i do it right?
maybe i can serve facebook ‘channel.aspx’ instead?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:30:14+00:00Added an answer on June 11, 2026 at 9:30 pm

    Here is how you do it in asp.net per this link:

    1. Create a Generic HTTP Handler (ashx file):

      public class FacebookChannel : IHttpHandler
      {
      
          public void ProcessRequest(HttpContext context)
          {
      
              HttpResponse response = context.Response;
              response.ClearHeaders();
      
              const int cacheExpires = 60 * 60 * 24 * 365;
              response.AppendHeader("Pragma", "public");
              response.AppendHeader("Cache-Control", "max-age=" + cacheExpires);
              response.AppendHeader("Expires", DateTime.Now.ToUniversalTime().AddSeconds(cacheExpires).ToString("r"));
              context.Response.ContentType = "text/html";
              context.Response.Write("<script src=\"//connect.facebook.net/en_US/all.js\"></script>");        
          }
          public bool IsReusable { get { return false; } }
      }
      

    Make sure you reference the URL in your FB.init function:

    channelUrl : ‘//WWW.YOUR_DOMAIN.COM/fbchannel.ashx’,

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According MSDN, FxCop is an application that analyzes managed code assemblies (code that targets
I'm using the Facebook iOS SDK . In my code I have authorized my
According to Facebook: The best place to put this code is right after the
I am trying to make my online app communicate with Facebook. According to their
I use Facebook JavaScript SDK in Metro Mode of Windows 8 with JavaScript based
According to the Facebook API documentation, most of the work is handled through javascript.
According to its API documentation , the Facebook.init() method allows you to pass an
Possible Duplicate: Html validation error for property attribute According to facebook to use their
According to Facebook's Graph API documentation ( here ), you can access various sizes
According to Facebook, FBML has been deprecated and will be removed on July 5th

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.