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 9025053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:10:37+00:00 2026-06-16T06:10:37+00:00

I have an application, which I need to also make available offline. I have

  • 0

I have an application, which I need to also make available offline. I have no problem building dynamic content on the client with Javascript/Jquery vs doing it on the server, but I’m stuck with the basic page layout.

Right now my server-only pages are structured like this (I’m using Coldfusion):

<cfsavecontent variable="renderedResults">
    <!--- Doctype --->
    <cfinclude template="../templates/tmp_pagetop.cfm">
    <cfoutput><head></cfoutput>
    <cfif NOT isAjaxRequest()>
        <!--- page header with all meta/js/css/icons... --->
        <cfinclude template="../templates/tmp_pageheader.cfm">
    </cfif>
    <cfoutput>
            <title>#variables.title# | #tx_select_title#</title>
        </head>
        <body>
        // page
        </body>
    </html>
    </cfoutput>
</cfsavecontent>

<!--- COMPRESS --->
<cfscript>
    compressedHTML = reReplace(renderedResults, "\>\s+\<", "> <", "ALL");
    compressedHTML = reReplace(compressedHTML, "\s{2,}", chr(13), "ALL");
    compressedHTML = reReplace(compressedHTML, "\s{2,}", chr(09), "ALL");
    variables.alredayBinary = "false";
</cfscript>
<!--- GZIP --->
<!--- SET HEADER --->
<!--- SEND BACK --->

I’m using Jquery Mobile, which loads the first page with full head and then never uses the header again, when requesting subsequent pages via Ajax. I’m therefore checking whether the page is requested via Ajax and if so, I skip sending 8k of header to the client on subsequent page requests, because they are not used by JQM.

Also, my header template includes a lot of conditional content like this:

<cfif structKeyExists(cgi, "HTTP_USER_AGENT" ) AND findNoCase("facebook", cgi.http_user_agent) NEQ 0>
    <cfoutput>
        <meta property="og:title" content="#variables.title#"/>
        <meta property="og:type" content="website"/>
        <meta property="og:url" content="#variables.base#" />
        <meta property="og:site_name" content="#variables.user_firma#"/>
        <meta property="og:description" content="#variables.user_fbds#"/>
        <meta property="fb:admins" content="#variables.user_fbadmin#" >
    </cfoutput>
</cfif>

So I only include the Facebook Open Graph meta, when the page is requested by Facebook. This way the page if requested by Google passes W3C validation.

Challenge now… how to make this static and available offline.

I have been thinking about it for a while and not really come up with a good solution. If I

  1. Serve the full page = I fail W3C validation and online users get
    8k penalty (yes, it’s gzipped, but still) on every page request
  2. Serve the page without header = not really an option
  3. Serve two versions of the page (one for online, one for offline
    usage) = the offline page will be cached and the user will be
    “stuck” with that version from cache, even if he is online.
  4. Only make the first page with full header = users starting on pages other than the first will be on a broken page (no header). Main page also fails validation.

I’m sure, I can’t have it all, but I would like to know which approach can be taken to do this the best way possible.

Thanks for inputs!

  • 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-16T06:10:38+00:00Added an answer on June 16, 2026 at 6:10 am

    You can set a session variable to denote that the header is loaded. Then, on each page check for that variable, and if it’s there, show only the content; and if it’s not there, show the head + content.

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

Sidebar

Related Questions

I have a relatively simple application which I need to make native Mac OSX
I have a client server application in which I need to transmit a user
I have a phonegap application which will need to take a zip archive of
I have an application in which I need to pass an array from C#
I have a C# MVC application which I need to output the following data
I have a simple application in which I need to let the user select
Hai I have an application which is designed in netbeans6.0.1 where i need to
I have a win32 GUI (MFC) application which I need to port to a
I have an application based on google map, in which I need to use
I need to write a standalone Java application which will have a embedded HTTP

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.