前言:其实说它为技术,也许不能说是真正的技术。这只不过是我自已想出来的页面处理的方法,当然与别人的想法可能是一致的。不过我还是想给它一个好听的名字。那么我这里所指的页面缓冲是什么呢?就是指将动态生成的页面保存起来,供下一次的使用。这样下一次访问它可能就不需要动态生成了。就象提供了一个cache 一样,在我的网站上,也许你的网站也是如此,使用了象模板之类的技术,这样用户所看到的页面就是动态生成的。但是一个页面对于你是这样,对于别人可能还是这样,即在一段时间内是不会变化的,如果将上次生成的结果直接返回给下一次访问的用户不是更好吗?减少了生成时间,效率要高一些。我想随着网站的发展,速度与效率问题还是要考虑的。这里我给出我的实现,希望对大家有所帮助。只是一个思路,没有具体的实现。
使用条件:是不是所有的网页最好都使用呢?我想不需要,而且也不可能。之所以能缓冲就是因为下一次访问与上一次访问的内容可能是完全一样的。所以对于经常变化的页面就不合适了。比如页面上要显示计数信息的就不太合适。还有就是如果你的动态页面输出时,没有先输出到变量中,而是直接返回给用户,如使用echo,print ,readfile之类的输出,我个人认为现在还作不到。因为无法将输出结果得到,保存到文件中去(反正我是想了半天没有想出有什么可以将直将输出的东西截下来,重定向到文件中去),那么比较适的动态页面的处理就是:输出结果应该可以放到一个字符串之中。所以使用条件就是:页面基本不会变化
动态页面的处理结果可以存放到字符串中
这样使用模板类来处理动态页面就很好了。通过在模板中设置可替换的变量,然后根据实际的值替换相应的模板中的变量,同时可以将结果放到字符串中进行输出,这种模板类的处理非常适合保存处理后的页面。当然不使用模板类,也可以通过字符串的处理来生成输出结果也是可行的。至于怎么做就不讨论了。
实现:如前所述,不是一个真正的实现,而是一个实现的思路。
处理流程:根据访问的要求,生成缓冲文件名,查看文件名是否存在,如果文件不存在,则生成动态页面,将页面保存,同时输出结果,结束;如果存在,则执行第3步,统计文件的修改时间,及与动态页面生成有关的文件的修改时间,比较缓冲文件的修改时间与其它页面的修改时间,如果其它页面修改时间大于缓冲文件修改时间,认为动态结果可能会发生变化,则重新生成动态页面结果,保存到文件中,且输出结果,结束;否则执行第5步
说明缓冲文件最新,则直接输出缓冲文件:这就是我的处理m至于缓冲文件如何保存,可以建一个临时目录也可以使用数据库处理。如果使用了数据库则判断文件是否最新的方式也应作变化,比如在数据库中增加生成时间字段,比较这个时间字段与其它文件的修改时间即可,方法大家自已想。
波比源码 » 简单的页面缓冲技术
buy levaquin 500mg for sale levaquin uk
avodart 0.5mg oral buy flomax 0.4mg generic ondansetron online buy
spironolactone tablet order diflucan online cheap order diflucan pills
ampicillin 500mg usa bactrim over the counter erythromycin 500mg drug
purchase fildena pill tamoxifen uk generic methocarbamol 500mg
order sildenafil without prescription estradiol 2mg tablet order generic estradiol 2mg
brand lamotrigine prazosin 2mg tablet tretinoin cheap
purchase tadalafil sale order tadalafil 10mg online order voltaren generic
isotretinoin 40mg generic azithromycin generic order generic azithromycin 500mg
cost indomethacin indomethacin online order generic amoxicillin
cialis discount Best price viagra sildenafil 50mg pill
cheap arimidex Pfizer viagra purchase viagra generic
pharmacie en ligne tadalafil acheter 200mg sildenafil viagra 100mg pour homme
buy prednisone 5mg sale tadalafil dosage sildenafil 100mg us
tadalafil 5mg generika tadalafil 10mg bestellen viagra 200mg kaufen
order isotretinoin 20mg for sale stromectol pills for humans ivermectin 12mg oral
catapres 0.1 mg price meclizine online order buy spiriva online
benicar 20mg oral diamox ca buy diamox 250 mg pills
imdur 40mg pills azathioprine us telmisartan online order
buy zyban 150mg pills bupropion online order purchase quetiapine generic
order zoloft online cheap buy sildenafil 100mg pills order sildenafil
imuran 100mcg cost oral viagra 100mg sildenafil for men
tadalafil 40mg generic buy viagra online reviews female viagra pill
cialis next day delivery usa cheap amantadine symmetrel brand
naltrexone 50mg us buy femara sale aripiprazole usa
buy dapsone 100 mg for sale avlosulfon order online aceon 4mg ca
medroxyprogesterone ca oral biltricide 600mg buy periactin 4 mg online cheap
fluvoxamine 100mg us purchase cymbalta sale glipizide ca
purchase azithromycin generic order zithromax 250mg sale neurontin 600mg oral
cialis 40mg brand real viagra 100mg purchase viagra for sale
buy aralen online cheap buy olumiant 4mg olumiant order online
order metformin 500mg generic order metformin 500mg generic cialis pharmacy
clozaril brand buy ipratropium 100mcg generic buy decadron sale
order omeprazole 10mg for sale gambling games play money poker online
lopressor 100mg brand vardenafil 20mg oral levitra 20mg cheap
levitra 10mg over the counter medrol 16 mg online medrol 8 mg over counter
clomiphene 100mg price purchase clomiphene pill casino free spins no deposit
usa cialis sales cost cialis sildenafil 100mg us
purchase triamcinolone sale triamcinolone pills buy clarinex 5mg for sale
dapoxetine cost misoprostol 200mcg pill buy synthroid tablets
buy cialis pills buy tadalafil online cheap purchase viagra pill
cost orlistat 120mg cost xenical 120mg purchase zovirax pills
oral tadalafil 40mg order tadalafil 10mg pill plavix 75mg for sale
purchase methotrexate sale buy metoclopramide 20mg online metoclopramide oral
order domperidone for sale order flexeril 15mg without prescription cost flexeril
imitrex over the counter purchase dutasteride avodart online
ranitidine 150mg over the counter order celebrex 100mg pill order celebrex 200mg for sale
order tamsulosin 0.2mg aldactone cost buy aldactone pills
buy cialis 5mg without prescription female cialis pill brand cipro 500mg
zocor 10mg price order valtrex 500mg for sale order propecia generic
flagyl 400mg uk order bactrim 960mg sale buy bactrim 480mg for sale
fluconazole pill diflucan 100mg uk sildenafil price
order cephalexin 125mg generic order cleocin 300mg online order erythromycin 250mg
cialis 10mg uk viagra overnight shipping usa viagra pills 200mg
buy sildenafil pill viagra overnight shipping usa canadian cialis
online casinos real money casino online games for real money tadalafil generic name
buy desyrel 100mg generic suhagra 100mg for sale sildenafil 50mg us
cheap essay online order stromectol online cheap stromectol online pharmacy
sildenafil pills lamotrigine generic order lamictal for sale
deltasone 10mg usa oral deltasone 5mg order amoxil 1000mg pill
viagra 100mg cheap sildenafil sale order tadalafil 20mg
slot machine best male ed pills cost cialis 40mg
zithromax 500mg us order gabapentin 100mg without prescription purchase neurontin online
online casino usa order stromectol 3mg for sale provigil online buy
furosemide us plaquenil 200mg tablet hydroxychloroquine 200mg sale
oral prednisone order prazosin 2mg pill buy vermox for sale
buy fildena 100mg generic sildenafil 100mg us order budesonide
tadalafil canada buy indomethacin 50mg pills indomethacin 75mg cheap
buy lamisil pill cefixime 100mg brand buy amoxicillin 250mg pill
naprosyn 500mg sale omnicef 300 mg sale purchase prevacid online
order clarithromycin online cheap buy antivert 25 mg pill meclizine 25 mg canada
proventil for sale ciprofloxacin 500mg without prescription cipro 1000mg pill
buy tiotropium bromide 9 mcg sale spiriva 9mcg drug terazosin 1mg pill
buy montelukast online montelukast 5mg for sale viagra 100mg price
buy cialis 20mg generic online casino slots real casinos online no deposit
buy ivermectin stromectol stromectol us avlosulfon 100mg sale
best casino slot games best online poker sites slot machines
casino real money burton brunette no deposit casino
red dog casino canada online pharmacies cheap term papers
ramipril 5mg ca altace 10mg ca buy etoricoxib for sale
affordable essays leflunomide 10mg uk buy sulfasalazine 500 mg online
order generic asacol azelastine 10ml oral order irbesartan generic
order benicar 20mg sale verapamil 120mg cost depakote 500mg brand
temovate price buy buspar 10mg online cordarone 100mg price
coreg 6.25mg sale oxybutynin online elavil online order
fosamax 70mg us brand alendronate 35mg motrin 400mg brand
indocin 50mg tablet cenforce over the counter cenforce for sale online
order famotidine 40mg generic order tacrolimus 5mg for sale order mirtazapine online cheap
Thank you for content. Area rugs and online home decor store. Hello Administ . Metropol Halı Karaca Halı Öztekin ve Selçuklu Halı Cami Halısı ve Cami Halıları Türkiye’nin En Büyük Cami Halısı Fabrikasıyız…
tadalafil price plavix 75mg tablet trimox 250mg price
buy generic minocin 50mg hytrin medication terazosin 5mg oral
tadalafil 40mg sale approved cialis buy ed meds online
clomid 50mg price order clomid generic buy prednisolone 20mg without prescription
deltasone 20mg oral cost accutane 40mg amoxil over the counter
accutane 10mg drug buy acillin generic ampicillin 250mg over the counter
pills for erection best ed pill order proscar
ivermectin 20 mg stromectol 3mg tablet deltasone 10mg price