This blog has moved to http://ikhwanhayat.net

Monday, May 09, 2005

Not Exactly Really Simple Syndication

Ada dlm satu post yg lepas aku cerita pasal aku tgh buat RSS feed reader. "Just a stupid simple reader je", I quote myself. Tapi last2 jadi tak berapa nak simple pulak. Tapi tak ada la kompleks sgt. Antara yg aku dah buat supaya ia jadi tak berapa simple ialah: 1) Letak caching functionality. News yg di fetch dari source akan disimpan dlm cache, jadi tak perlu la request ke source tu setiap kali org panggil RSS reader kita. Dari side kita sendiri kelebihan paling ketara ialah kelajuan. Bagus betul, beratus kali ganda lagi laju sbb dah simpan dlm memory je. Aku ingat nak masterkan lagi pasal caching ni, sbb dlm ASP.NET ada mcm jenis caching yg boleh membantu kita melajukan aplikasi web kita. Yg aku buat ni istilahnya "Data Caching". Ada juga "Output Caching" dan lagi satu yg menarik ialah "Page Fragment Caching " (atau "Partial-Page Output Caching") kalau kita guna user control. Aku setakat ni just baca je, tak pernah guna betul2 lagi. Kalau korang terer cuba bagitau mcm mana nak sebut "cache"? 2) Aku gunakan Ajax (Asynchronous JavaScript and XML). Aku akan paparkan feed ni kat muka depan, yg obviously should already have a lot of content to display. So tak kan nak tunggu reader ni abis amik dari semua source baru nak display page ni, mesti lambat giler. So, aku just letak satu <DIV> sebagai stub. Gunakan XMLHttpRequest utk request satu page lain yg akan fetch dan proses feed tadi dan pulangkan content dari page ni masuk ke dalam stub tadi. I just realised the power of JavaScript (and the agony to code it!). 3) Disamping tu aku berpeluang bermain2 dgn web proxy. Request keluar dari local intranet di tapis oleh sebiji proxy kat sini, mcm biasa la. So code ASP.NET aku ni terpaksa la aku bikin supaya boleh supply credential yg betul utk request file RSS tu. Suddenly it became not so simple anymore. Tapi tu yg bikin seronok tu... Nak code? tak boleh la, proprietary copyright of my kompeni hindia timur inggeris :) Kalau betul nak nanti aku code lain kasi korang... (Kalau rajin lah)

8 Comments:

At 5/10/2005 09:17:00 am, Anonymous Anonymous said...

what is VaryByParam ? can explain?
cache = ade yg sebut "kake"
hhaha...

 
At 5/10/2005 05:33:00 pm, Blogger Ikhwan Hayat said...

apa tanya aku, kan aku kata belum master lagi benda2 tu..
tapi sila rujuk sini:
http://aspnet.4guysfromrolla.com/articles/022802-1.aspx

The VaryByParam is a useful setting that can be used to cache different "views" of a dynamic page whose content is generated by GET or POST values. For example, you may have an ASP.NET Web page that reads in a Part number from the QueryString and displays information about a particular widget whose part number matches the QueryString Part number. Imagine for a moment that Output Caching ignored the QueryString parameters altogether (which you can do by setting VaryByParam="none"). If the first user visited the page with QueryString /ProductInfo.aspx?PartNo=4, she would see information out widget #4. The HTML for this page would be cached. The next user now visits and wished to see information on widget #8, a la /ProductInfo.aspx?PartNo=8. If VaryByParam is set to VaryByParam="none", the Output Caching engine will assume that the requests to the two pages are synonymous, and return the cached HTML for widget #4 to the person wishing to see widget #8! To solve for this problem, you can specify that the Output Caching engine should vary its caches based on the PartNo parameter by either specifying it explicitly, like VaryByParam="PartNo", or by saying to vary on all GET/POST parameters, like: VaryByParam="*"

aku tak berapa ambil peduli sbb aku transfer data antara page guna Context.Item[], tak pakai POST/GET..

p.s: aku kenal ko ke?

 
At 5/11/2005 09:06:00 am, Anonymous Anonymous said...

aha...but as you are in asp environment u should know that... ;)

 
At 5/11/2005 10:15:00 am, Blogger Ikhwan Hayat said...

Yeah, in a matter of fact, I will.. But maybe later, can't stuff it all in one time, can we?

 
At 5/12/2005 08:58:00 am, Anonymous Anonymous said...

did u know that microsoft want to overtake java

 
At 5/12/2005 09:12:00 am, Blogger Ikhwan Hayat said...

Of course.. thats why VBScript, JScript, J++, J# came into place..
in business, everybody wanna overtake everybody else..

 
At 5/12/2005 04:57:00 pm, Anonymous Anonymous said...

hahaha...perfect...everybody wanna overtake averybody else..i think i wanna overtake ur brain looorrr

 
At 5/12/2005 05:02:00 pm, Blogger Ikhwan Hayat said...

wanna overtake? please, be my guest..

wanna takeover? that one cannot! abis tu aku jadi apa? zombie?

 

Post a Comment

<< Home