server-side-includes

ASP.NET Directive Convention for Declaring Client-Side Includes

和自甴很熟 提交于 2019-12-03 21:05:31
I am loading .aspx and .ascx files as StreamReader . I want each file to register it's javascript and stylesheet dependencies in some declaration like a <%@ ClientDependency path="~/Scripts/jquery-1.4.1.min.js" %> . Is there an existing convention for doing such a thing? I don't need an implementation, but I don't want to create a new syntax if there is already a way to do it. Also, what are the guidelines for custom <%@ blocks in ASP.NET? Also, please retag this question if you can think of a more appropriate description. Have you considered Google Loader or something like this: Enabling the

How do I limit PHP apps to their own directories and their own php.ini?

核能气质少年 提交于 2019-12-03 19:38:53
问题 I am running multiple PHP apps on my Mac, running OS X 10.5.6, Apache 2, PHP 5. I have subdomains setup for each project, a host file entries for each subdomain, and Virtual Directory blocks in the Apache config. So project1.localhost goes to /Library/WebServer/Documents/Project1 project2.localhost goes to /Library/WebServer/Documents/Project2 etc... However, this method doesn't really "isolate" the web apps. For example, if I include a script like so: <?php include("/includes/include.php");

Varnish and ESI, how is the performance?

你说的曾经没有我的故事 提交于 2019-12-03 12:39:24
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? 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" />, <esi:include src="/station/bluesclub" />, <esi:include src="/station/jazzloft" />, <esi:include src="

Can I include a PHP file in an SHTML file and store the result in a SHTML variable?

时光怂恿深爱的人放手 提交于 2019-12-02 10:06:10
I want to include a PHP file in an SHTML file and store the result in a SHTML variable and include different things depending on the result. Example: Assume the PHP script would echo 0/1 in plain text (depending on something like time or something). And then in the SHTML, I'd like to store the output of that PHP file in a SHTML variable. Then if the value stored in that variable is 1, include fileA.html, else include fileB.html. Doesn't sound possible. SHTML uses different methods of parsing the code so I don't think the PHP will run on the page to return a value to the SHTML. Why are you

What is the scope of require_once in PHP?

喜夏-厌秋 提交于 2019-11-30 22:41:24
问题 Simple question: Is the scope of require_once global? For example: <?PHP require_once('baz.php'); // do some stuff foo ($bar); function foo($bar) { require_once('baz.php'); // do different stuff } ?> When foo is called, does it re-parse baz.php? Or does it rely on the already required file from the main php file (analagous to calling require_once twice consecutively for the same include file)? I saw this thread before, but it didn't quite answer the question: Should require_once "some file

Use web.config to allow server-side includes in HTML files (IIS)

不想你离开。 提交于 2019-11-30 20:24:35
In IIS 7.5, is it possible to use web.config alone to enable SSI processing for files that have the .html extension? Specifically, I don't want to use the default SSI extension, .shtml . Reason: I don't want to change the extensions. Doing so would lead to broken links in search engine results. Also, my motivation for doing this in web.config is because this is a shared server . Presuming that your hoster has enabled SSI's and delegated Read/Write permissions for handler mappings then this should work: <configuration> <system.webServer> <handlers> <add name="SSINC-html" path="*.html" verb="*"

Using too many PHP includes a bad idea?

早过忘川 提交于 2019-11-30 17:32:10
My question is whether or not using multiple PHP includes() is a bad idea. The only reason I'm asking is because I always hear having too many stylesheets or scripts on a site creates more HTTP requests and slows page loading. I was wondering the same about PHP. The detailed answer: Every CSS or JS file referenced in a web page is actually fetched over the network by the browser, which involves often 100s of milliseconds or more of network latency. Requests to the same server are (by convention, though not mandated) serialized one or two at a time, so these delays stack up. PHP include files,

Server side includes alternative

旧巷老猫 提交于 2019-11-30 07:28:15
问题 I have a static site hosted on GitHub Pages which is starting to grow in size. Normally I would use server side includes ( <?php include('path to file'); ?> ) to bring in header, footer and any navigation files. However php doesn't run on GitHub Pages. Is HTML5 embedding which adopts a sort of iFrame technique my only option here? I have seen threads such as this, this, this, this however they do not seem to apply for GitHub pages. Not really ideal. Thanks. 回答1: Jekyll is a common solution

Using too many PHP includes a bad idea?

若如初见. 提交于 2019-11-30 01:19:22
问题 My question is whether or not using multiple PHP includes() is a bad idea. The only reason I'm asking is because I always hear having too many stylesheets or scripts on a site creates more HTTP requests and slows page loading. I was wondering the same about PHP. 回答1: The detailed answer: Every CSS or JS file referenced in a web page is actually fetched over the network by the browser, which involves often 100s of milliseconds or more of network latency. Requests to the same server are (by

Why SSI condition != || != doesn't work?

让人想犯罪 __ 提交于 2019-11-29 16:30:40
I can't get working this conditional expression <!--#if expr="$DOCUMENT_NAME!=index.html || $DOCUMENT_NAME!=links.html" --> while this one without ! before = works perfect <!--#if expr="$DOCUMENT_NAME=index.html || $DOCUMENT_NAME=links.html" --> What's the problem? I get no error simply != doesn't work though || with other condition but works for single condition. This is because = and != are hardly the same operator. Note that, by De Morgan's law (which I also explained in this old post ), a != b || c != d is equivalent to a = b && c = d which is never true for x = a && x = b where a != b .