perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Peters <mpet...@plusthree.com>
Subject Re: Any success with storing photos in a database?
Date Tue, 30 Sep 2008 13:11:16 GMT
Himanshu wrote:

> A newbie question in the insightful thread. Can serving static files
> and cookie authentication go together? 

Yes. You can do this with something like mod_auth_tkt in a proxy web server (very light) and
have a 
backend mod_perl (or php, or Java, etc) server set the cookie after someone has logged in.
Then you 
just configure your auth in your proxy for which groups have access to which files.

> Second what
> are the sizes at which one should start moving to files. e.g. how
> about plain text blog entries containing no more than say 5 KBytes.

It really depends on you database. In MySQL using BLOBS won't really cause
problems unless you use queries that involve full table scans or queries that actually pull
or 
manipulate the BLOBS a lot. So if you have the proper indexes and only pull the BLOBS rarely,
then 
you should be ok for most uses.

But as far as blogs go, you really shouldn't be pulling the text of the blog out of the DB
for every 
request. Since it changes very rarely, especially compared to the number of times it's read
then 
storing it in a "published" state on the filesystem is usually best. And if you still need
to add 
dynamic bits to the page at run time, then instead of publishing a .html file, you can publish
a 
template (for Template Toolkit, HTML::Template, etc).

-- 
Michael Peters
Plus Three, LP


Mime
View raw message