Lasso Soft Inc. > Home

[lp_client_isPrefetch]

Linklp_client_isPrefetch
AuthorBil Corry
CategoryBytes
Version8.x
LicensePublic Domain
Posted24 Aug 2006
Updated24 Aug 2006
More by this author...

Description

Google Web Accelerator and Mozilla browsers can prefetch pages, basically load pages that appear as links on the current page.  This tag looks to see if  the header "x-moz: prefetch" is present, if so, the page is being prefetched by the client browser.

Sample Usage

if: lp_client_isPrefetch;
  'You are prefetching this content!';
/if;

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

[

define_tag: 'lp_client_isPrefetch',
	-description='Returns true if client is doing a prefetch.',
	-priority='replace';

	// looks for header "x-moz: prefetch" currently sent by Google Web Accelerator and Mozilla browsers

	// more info on prefetching:
	//   http://webaccelerator.google.com/webmasterhelp.html
	//   http://www.mozilla.org/projects/netlib/Link_Prefetching_FAQ.html#Do_prefetched_requests_contain_a
	//   http://david.backpackit.com/pub/37983

	if: (string_findregexp: client_headers, -find='x-moz:\\s+.*prefetch', -ignorecase)->size;
		return: true;
	/if;
	return: false;

/define_tag;

]

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft