Welcome Guest, Not a member yet? Register   Sign In
caching a dynamic page
#1

[eluser]mrahman[/eluser]
Hi,

Code:
MEMORY USAGE
1,913,632 bytes

BENCHMARKS                                
Loading Time Base Classes                         0.2121
Controller Execution Time ( Services / Index )    0.3960
Total Execution Time                              0.6083


These are the data generated by the profiler.
Regardless of the reason, can you tell if this is a problem, or these numbers represent reasonably fine performance?
And, given these statistics, should i worry when expecting around 12~15 visitors in one minute?

Another question about caching. Normally you cannot use catching when all of your pages has dynamic contents, even if it were just the guest/user login/editAccount anchor. any workarounds yet?

Thanks much.
#2

[eluser]Michael Wales[/eluser]
There is no work-around for caching dynamic data because that would defeat it's entire definition (caching is the process of generating a static file to be served to users, rather than querying the database every time).
#3

[eluser]mrahman[/eluser]
oh. so there is no "cache this (or serve if catched), and don't cache that." Will caching a view be a good feature request or not? (i feel like NO).
The Profiler data above really varies greatly at different day hours. The worst was around 8 seconds with 2mb memory usage. Is this a real threat (and so caching becomes inevitable someway)?
#4

[eluser]beemr[/eluser]
Actually, views are just about all that CI caches. Elliot Haughin has a great post about the CI cache on his blog. There's Query caching, too, but I haven't tried it yet.

Check the wiki for Slightly Better Caching. It'll allow you to cache a "dynamic" page but with generic tokens like "{cached::name}". When it comes time to serve the dynamic page from the cache, it quickly swaps out the tokens for the user's unique data stored in the $_SESSION.

Also, look for "Clear Page Cache". That's a simple cache deletion function that you could call anytime you update a page on the backend. You have to plan out your pages a little more carefully, but it beats rebuilding 95% of a page over and over again.
#5

[eluser]mrahman[/eluser]
perfect, beemr. thanks eveyone




Theme © iAndrew 2016 - Forum software by © MyBB