server-side-includes

Conditional SSI Based on URI

梦想与她 提交于 2020-01-15 16:47:07
问题 I am redoing the navigation bar that is included several dozen of my site's pages. One of the changes that I want to make is to vary the content that is included, based on the page that the user is on. Thus my plan is basically to have the file that is currently included everywhere act as a selector to decide which actual file(s) to include. From the my reading of the Apache SSI Specs, I believe I can do this through conditional expressions driving my SSI. Something like: <!--#if expr="[URI

PHP Check If require_once() Content Is Empty

感情迁移 提交于 2020-01-02 08:05:09
问题 I am working on a PHP script which involves me including several external PHP scripts via the "require_once()" method. I would like to know if there is a way for the master script (the one including the others) to tell whether or not the processed output from included script has generated any content. So, for example, maybe the user's permissions for a particular script results in PHP not generating any output. So, maybe, the master script would echo something like: Nothing interesting here!

SSI or PHP Include()?

霸气de小男生 提交于 2020-01-01 08:48:19
问题 basically i am launching a site soon and i predict ALOT of traffic. For scenarios sake, lets say i will have 1m uniques a day. The data will be static but i need to have includes aswell I will only include a html page inside another html page, nothing dynamic (i have my reasons that i wont disclose to keep this simple) My question is, performance wise what is faster <!--#include virtual="page.htm" --> or <?php include 'page.htm'; ?> 回答1: Performance wise fastest is storing the templates

Varnish and ESI, how is the performance?

喜夏-厌秋 提交于 2020-01-01 04:44:06
问题 Im wondering how the performance of th ESI module is nowadays? I've read some posts on the web that ESI performance on varnish were actually slower than the real thing. Say i had a page with over 3500 esi includes, how would this perform? is esi designed for such usage? 回答1: We're using Varnish and ESI to embed sub-documents into JSON documents. Basically a response from our app-server looks like this: [ <esi:include src="/station/best_of_80s" />, <esi:include src="/station/herrmerktradio" />

Server Side Includes

为君一笑 提交于 2019-12-25 06:35:35
问题 I got the following error message in the Apache log: unable to include potential exec "header.html" in parsed file /Users/sikusiku/Sites/ss-git/homepage.shtml I basically tried to include header.html from homepage.shtml . I used the very basic directive in homepage.html (both header.html and homepage.shtml are located in the document root): <!--#include virtual="header.html" --> I think I have properly turned on the SSI in my httpd.conf : Options Indexes FollowSymLinks ExecCGI Includes ...

Server Side Includes

坚强是说给别人听的谎言 提交于 2019-12-25 06:35:16
问题 I got the following error message in the Apache log: unable to include potential exec "header.html" in parsed file /Users/sikusiku/Sites/ss-git/homepage.shtml I basically tried to include header.html from homepage.shtml . I used the very basic directive in homepage.html (both header.html and homepage.shtml are located in the document root): <!--#include virtual="header.html" --> I think I have properly turned on the SSI in my httpd.conf : Options Indexes FollowSymLinks ExecCGI Includes ...

Best way to avoid including stylesheets/external js more than once in a page

你。 提交于 2019-12-24 10:45:00
问题 I've having to clean up/maintain some old php site files. There are a number of main php pages which include() other php files based on rules. A number of these includes have lines such as below in them: <link href="css/styles.css" rel="stylesheet" type="text/css"> <script language="javascript" src="js/functions.js"></script> Some of the time after the php page has been built, these external files are included more than once in the same page. It's not just a simple case of removing these

server-side includes and character encoding

和自甴很熟 提交于 2019-12-23 13:24:09
问题 I created a static website in which each page has the following structure: Common stuff like header, menu, etc. Page specific stuff in main content div Footer In this website, all the common content is duplicated in each page. In order to improve the maintainability I refactored the pages to use server-side includes (SSI) so that the common content is not duplicated. The structure of each page is now SSI for Common stuff like header, menu, etc. Page specific stuff in main content div SSI for

Problems with Server-side Includes

那年仲夏 提交于 2019-12-23 12:55:25
问题 I desperately want to use server-side includes in a project I'm working on because I just have some HTML that repeats and I need to get it on several pages. Must I use ascx or some other include technology... I mean, will lightning strike if I use server-side includes? My client -- the middle-person -- says "do what's easiest, this will probably be redone in a CMS soon anyway." Can I not use server-side includes? It's ASP.NET 2.0. Note: I feel this has been asked before, but I couldn't find

Server Side Include on S3

别来无恙 提交于 2019-12-22 08:57:59
问题 Amazon S3 has static website hosting, but does not support tags like: <!--#include virtual="i/header.htm" --> <!--#echo var="i/header.htm" --> <!--#include file="i/header.htm" --> Is there anyway to mimic this functionality without having some sort of JavaScript/AJAX content request for the header on every page on S3? 回答1: You could use javascript to assemble the page in the client browser. With jQuery: $('#header').load('header.html'); This has a serious SEO drawback-- search engines like