Jump to content

Archived

This topic is now archived and is closed to further replies.

448191

Ajax updates and client/proxy caching; use subsequent requests or not?

Recommended Posts

Still working on my ajax enabled application.

I'm struggling with this issue: If I want to optimize client/proxy caching, I have to use seperate files for each component being updated, triggered by a single user action.

What I mean is, what if the components being uppdated have very different lifetimes? If I use a single file, I have to use the lowest compent's lifetime as max-age for the whole update file. What if one or more of these components don't change very often. That would be a shame to have requested over and over again, just because a component with a shorter lifespan was also requested.

Otherwise, I'd have to use subsequent requests to get all updated components.

But how does a server handle many tiny requests? Does it cause latency because a server can only handle so much requests at the same time, or shouldn't I worry about that? Does anyone have any expertise to share on that subject?

Share this post


Link to post
Share on other sites
C'mon, I'ts not like I'm asking you to explain the theory of relativety to me.

Ok, let me share some more thoughts, hopefully somebody will step in and fix my ignorance.

1) There probably isn't a standard rule for how many simultanious requests a server can handle, because, I reckon, it depends to much on the server. Dedicated or virtual, connection, hardware, etc... I could probably write a script that tries to overload a server when setting up the application and use statting during normal operations to determin wether a server is near a point where it will overload. It would be easy though, and would very much be like a viral brute force attack, since I would need a lot more than one client to bring down a server. Also, I don't think many hosting companies will like me to overload a shared server.  :P

2) I guess my choice should also depend on how much the lifetime of components vary. If it varies a lot, less requests be made, and the difference in number of requests compared to using a single file will be limited, because clients and proxies can use their copies of smaller update files longer.

This considered, I should probably go with subsequent updating... PLEASE step in if you think you have ANYTHING of relevance to share on this subject.

Share this post


Link to post
Share on other sites
Well, since nobody is replying, I think I'll make it OPTIONAL. Once the application is deployed, let practice decide what works best.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.