Gossamer Forum
Home : Products : Gossamer Links : Discussions :

static or dynamic - pugdog?

Quote Reply
static or dynamic - pugdog?
Hi, I noticed that Pugdog's http://www.linkssql.com site called most of the pages using the page.cgi script. Is there any major disadvantage over this and why would you want to use page.cgi instead of building the pages?

Jeffb

PS. Could someone help me with this thread(!):
http://www.gossamer-threads.com/...NG&Number=127425

Quote Reply
Re: static or dynamic - pugdog? In reply to
This is a basic outline of the differences:

Static - Builds a physical 'static' HTML page for each category and sub-category. Uses more disk space, requires a re-build for any changes you make to links, cats, etc. but provides a quicker method of browsing since you are calling a 'page' of HTML rather than processing the page contents each time and can take advantage of browser's cache when moving back through pages already viewed. In addition, if your scripts 'go down' you and your visitors can still refer to the category pages.

Dynamic - Doesn't build category pages. Uses less disk space, doesn't require a re-build for changes, but uses much more of your server resources since it 'builds' every page, every time it is requested, regardless of whether you've already looked at that page. However, if your scripts 'go down' so do your category pages since it is the scripts that build each page 'on-the-fly'.

Hope this helps Smile

All the best
Shaun

Quote Reply
Re: static or dynamic - pugdog? In reply to
That's about right.
What I've been doing is using page.cgi right now,
until I'm ready to release my directory.

Once it's ready for prime time viewing, I'm going to use a static build.

Page.cgi is good for developing because any changes you make can be seen instantly, instead of rebuilding the entire directory.

Just a though. Smile

Robert Blackstone
Webmaster of Scato Search
http://www.scato.com
Quote Reply
Re: static or dynamic - pugdog? In reply to
I'm switching slowly over to dynamic pages, as I'm finding a few pages are being called much, much more often than others, and under SpeedyCGI the performance is pretty good. I avoid the build delay.

Static pages _really_ have an advantage on sites where the data doesn't change very often, but there is high traffic. You can get much higher through put, since there is a much lower CPU load.

Because of the amount of changes I'm doing, I've got everything running page.cgi because the builds were consuming way too much time.

I might go back to static pages, _BUT_ the biggest advantage of dynamic pages, is it allows user-logon and personalization. You could get a "similar" effect with SSI, but if you are going that route, you might as well go whole-hog and just do it from the git go.


PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: static or dynamic - pugdog? In reply to
In Reply To:
could get a "similar" effect with SSI
SSI is very deceptive. If you used something like the UserLookup plugin which lets you display the user who is logged on via SSI, you are essentially adding the same load on your server as if you were using page.cgi.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: static or dynamic - pugdog? In reply to
one other difference is search engines. Only google.com at the moment i think stored ?= strings. For a site that only uses page.cgi some sort of search engine "tricker" is needed. Either using a re-write like the www.gossamer-threads.com/p/34345 type system or doing something like www.domain.com/page.cgi/path/to/etc/ where you can then explode the variables inside page.cgi to make page.cgi show the correct page.

http://www.ASciFi.com/ - The Science Fiction Portal
Quote Reply
Re: static or dynamic - pugdog? In reply to
It also totally depends on how you want your directory to behave. In my situation, I changed all the "is Validated" bits from No to Yes, so that I *don't* have to have an administrator approve additions. It's automatic and new entries are immediately viewable.

In order to make this work, I had to use Dynamic instead of Static.

--Bri

Quote Reply
Re: static or dynamic - pugdog? In reply to
In Reply To:
It also totally depends on how you want your directory to behave. In my situation, I changed all the "is Validated" bits from No to Yes, so that I *don't* have to have an administrator approve additions. It's automatic and new entries are immediately viewable.
I will do this also just as soon as I can afford to have Alex whip me up some code to valitate submissions against certain criteria ('this' required, 'that' not allowed, etc) I'm told it's not complicated which may be true for someone well versed in perl but it is beyond my ability.

Mark Brasche
http://SurfSafely.com/
Quote Reply
Re: static or dynamic - pugdog? In reply to
pardon the newbie"ness"

umm,

is the link just called different from the browser or what ????

cgi-bin/links_204/pages/
vs
cgi-bin/links_204/cgi/page.cgi

I'm not getting this like usual ;-)

would you mind?

Quote Reply
Re: static or dynamic - pugdog? In reply to
To use dynamic pages, as long as you used the default install, you would just use something like:

http://domainname.com/cgi-bin/page.cgi

To use different template sets, you would just use:

http://domainname.com/cgi-bin/page.cgi?t=yahoo

To display a single template page, not officially part of links, create the template, then call it:

http://domainname.com/cgi-bin/page.cgi?p=your_template


PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: static or dynamic - pugdog? In reply to
thanks

Quote Reply
Re: static or dynamic - pugdog? In reply to
However, running the Userlookup plugin as a javascript source should be much more resource friendly than SSI. Especially under Speedycgi or Mod perl.

Just my 2 cents...

:)

AlexJ

Quote Reply
Re: static or dynamic - pugdog? In reply to
Client-dependent...too much work to make the javascript inter-operatable between browsers, especially with the dramatic changes Netscape has made with interpreting javascript codes (shift from layers to DOM).

Server-side solutions are better, in my opinion...

Just my two cents...

Regards,

Eliot Lee
Quote Reply
Re: static or dynamic - pugdog? In reply to
Generally, Javascript is a real pain in the butt to keep working with all the browsers... But the JS that is used for this function is so basic and little work.... it is one line of code:
Code:
document.write('$username')
I don't see that causing any problems with any current (and hopefully future) browser that supports JS at any level....

AlexJ

Quote Reply
Re: static or dynamic - pugdog? In reply to
Hi all!

I'd like to use dynamic pages, but with the RewriteRules so that all the links *look* like static pages.

I've looked at some of the threads that discuss RewriteRules, and they are very informative, (http://www.gossamer-threads.com/...ew=&sb=&vc=1 for example) but what I'm confused on is how to get them to work with a dynamic page build.

The way I understand it, if I have LinkSQL set to use dynamic pages, when page.cgi creates a link to a subcat, for example, it'll produce something like:

http://mydomain.com/cgi-bin/links/page.cgi?g=MainCategory/Subcategory/index.html

But what I want the url to be is:
http://mydomain.com/links/MainCategory/Subcategory/index.html

So how do I get LinksSQL to use the static-style URL when creating the dynamic pages?

Any help is greatly appreciated!


Matt Glaspie
Quote Reply
Re: static or dynamic - pugdog? In reply to
To have people type in a static URL, and get to your categories, you'd be wanting to do something like:

http://mydomain.com/links/MainCategory/Subcategory/index.html

to make it look like:

http://mydomain.com/cgi-bin/links/page.cgi?g=MainCategory/Subcategory/index.html

you'd want to do something like:


RewriteEngine On
RewriteRule /links/(.*) http://mydomain.com/cgi-bin/links/page.cgi?$1 [R,L]

This will take incoming URL's and change them, but to try to reverse proxy it, you'd probably really have to do just that...





PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: static or dynamic - pugdog? In reply to
Thanks Pugdog, but as I understand it, there are actually two parts to this. First is setting up the RewriteRule, and second is getting page.cgi to *output* a static-looking url when building a dynamic page. It's this second part where I need help.

Right now, for example, if you are using dynamic pages, all the links on your pages will point to
page.cgi?g=Category/Subcategory/index.html

But, I want them to point to
http://domain/links/Category/Subcategory/index.html

So that when search engines come to spider my site, they'll only see "static" looking urls and should therefore index the site with no problem.

I thought maybe the "Subcategory.html" template, but the tag for the URL is simply "<%URL%>", what I need is a way to change the value that is placed in <%URL%> to the static version, even though I'm using dynamic pages.

Sorry if I didn't explain it clearly enough originally. Does this make more sense now? I'm sure there is a programming solution to this, but I was hoping there was a setting somewhere that I was just wasn't finding.

Any suggestions?

Thanks,

Matt Glaspie
Quote Reply
Re: static or dynamic - pugdog? In reply to
Page.cgi can't output a static looking page. That's what I addressed in the last part. In order to be dynamic, you have to output dynamic pages.

To get around that, you'd probably have to use proxy/proxy reverse, and that incurs a lot of overhead. You'd take in the original url, pass it to another process as the proxy URL, then take it back, and rewrite it to the old URL.

I don't think "rewrite" can can do reverse writing, that is what proxy does.

Search engines index dynamic content all the time. The most important factors seem to be meta tags and whether the robots.txt file said go away.



PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Quote Reply
Re: static or dynamic - pugdog? In reply to
Pugdog, I don't think we're talking about the same thing...

I don't want to output a static looking *page*, I want all the links ON the dynamically-output page to look like they are static.

I don't care what appears in the browser's location bar when the script is processed. It can continue to be page.cgi?whatever. But anywhere there is a link *to* page.cgi on the pages output by any LinksSQL scripts, I want that link-to URL to be the static-looking url...

Here's an example of how subcategory listings are output by page.cgi... The first example shows the URLs currently used in the listings, the second example shows what I'm trying to get.

Example of URLs currently ouput by dynamic LinksSQL pages:
In Reply To:
<h2>Categories:</h2>
<div class="margin"><table border=0 width="100%"><tr><td class="catlist" valign="top">

<strong><a class="link" href="http://thedomain.com/cgi-bin/links/page.cgi?g=Business/Accounting/index.html">Accounting</a></strong> <small><class="numlinks">(0)</small>

<strong><a class="link" href="http://thedomain.com/cgi-bin/links/page.cgi?g=Business/Business_Services/index.html">Business Services</a></strong> <small><class="numlinks">(0)</small>

<strong><a class="link" href="http://thedomain.com/cgi-bin/links/page.cgi?g=Business/Business_to_Business/index.html">Business to Business</a></strong> <small><class="numlinks">(0)</small>

</td></tr></table></div>
Example of how I want link-to URLs ouput by dynamic LinksSQL pages to appear:
In Reply To:
<h2>Categories:</h2>
<div class="margin"><table border=0 width="100%"><tr><td class="catlist" valign="top">

<strong><a class="link" href="http://thedomain.com/links/Business/Accounting/index.html">Accounting</a></strong> <small><class="numlinks">(0)</small>

<strong><a class="link" href="http://thedomain.com/links/Business/Business_Services/index.html">Business Services</a></strong> <small><class="numlinks">(0)</small>

<strong><a class="link" href="http://thedomain.com/links/Business/Business_to_Business/index.html">Business to Business</a></strong> <small><class="numlinks">(0)</small>

</td></tr></table></div>
So in other words, the page is still dynamic, it's just a matter of the content of the page containing different link-to urls for subcategories...

Does this clarify the situation?

I appreciate your help so far, Pugdog! Thanks for any additional advice,

Matt Glaspie
Quote Reply
Re: static or dynamic - pugdog? In reply to
Ah, I think I may have found the solution, and it seems to *ahem* just be a matter of changing the "dynamic_pages" setting to No...

For some reason, I thought that would cause page.cgi to no longer function, but instead, it appears to be producing the intended result: the link-to URLs are being output by page.cgi as the "static" versions instead of the dynamic versions.

Now I just need to figure out how to set up the RewriteRule so that when the link is clicked on, it goes to page.cgi instead of the non-existant "static" page...

Thanks for all your help, Pugdog!

Matt Glaspie
Quote Reply
Re: static or dynamic - pugdog? In reply to
Pugdog, I've got one question about the Rewrite rule itself you suggested above...

You've got the flags [R,L] at the end... From what I understand, the R flag forces a redirect and uses a little more system overhead. I'm just testing this right now, but it seems like the rule without the R ([L] only) is producing a more desirable result: the address in location bar *also* is appearing as the static version. (not a big deal, but still...)

I was just wondering if there is a specific need for that R flag... I'm reviewing the docs at http://httpd.apache.org/...e.html#RewriteEngine right now, but I'm not quite certain what exactly these flags do, as I'm by no means an Apache expert... :-)

Thanks again,

Matt Glaspie
Quote Reply
Re: static or dynamic - pugdog? In reply to
I think the R stands for redirect (not 100% sure).



Installations:http://www.wiredon.net/gt/
Favicon:http://www.wiredon.net/favicon/