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

  • SEARCH
  • Home
  • 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 8739299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:54:32+00:00 2026-06-13T10:54:32+00:00

Adding a Channel File greatly improves the performance of the Facebook JS SDK by

  • 0

Adding a Channel File greatly improves the performance of the Facebook JS SDK by addressing issues with cross-domain communication in certain browsers as per the documentation.

The contents of the channel.html file should be just a single line:

<script src="//connect.facebook.net/en_US/all.js"></script>

The channel file should be set to be cached for as long as possible.

In 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');
 ?>
 <script src="//connect.facebook.net/en_US/all.js"></script>

How to create the similar file in Perl?

  • 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-13T10:54:33+00:00Added an answer on June 13, 2026 at 10:54 am

    First, set up your channel.html file as a cgi-script (assuming that server runs under Apache) – you need to edit configuration file to add something like this:

    <Files "channel.html">
    AddHandler cgi-script .html
    Options ExecCGI
    </Files>
    

    and then just rewrite this file in Perl:

    #!usr/bin/perl
    
    binmode STDOUT;
    my $cache_expire = 60*60*24*365;
    print "Pragma: public\n";
    print "Cache-Control: max-age=",$cache_expire,"\n";
    print 'Expires: ', Mailtime(time+$cache_expire),"\n";
    print 'Content-Type: text/html; charset=utf-8'."\n\n";
    print '<script src="//connect.facebook.net/en_US/all.js"></script>';
    
    sub Mailtime { 
    my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); 
    my @wdays = qw(Sun Mon Tue Wed Thu Fri Sat); 
    my ($sec,$min,$hour,$mday,$mon,$year,$wday) = gmtime($_[0]); 
    return sprintf("%s, %02d %s %d %02d:%02d:%02d GMT", $wdays[$wday], $mday, $months[$mon], $year+1900, $hour, $min, $sec); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After adding Restkit to the Podfile : platform :ios dependency 'Facebook-iOS-SDK', '1.2' dependency 'RestKit',
I'm using Amazon .NET SDK, and adding file from my ASP.NET MVC app is
I am mapping a file("sample.txt") to memory using FileChannel.map() and then closing the channel
I have an xml file. <?xml version=1.0 encoding=UTF-8?> <channel> <item>content with special character é</item>
I'm working on adding a YouTube channel to my Android App and I'm having
Adding more and more configurations to my servlet container ( Embedded Jetty in my
Adding more than one child to a WPF StatusBar results in poor layout with
Adding Exceptional Handling is a good practise, but I have a doubt, In our
Adding the row one by one in the button click.. (i tried but its
Adding functionality to a class can be done by adding a method or by

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.