Re: [Cppcms-users] Caching files
Brought to you by:
artyom-beilis
|
From: Shiv S. D. <shi...@gm...> - 2013-12-04 12:35:32
|
I am working on online WenGL games. Now the use case is many will play and one user may download media files many times every day. On Wed, Dec 4, 2013 at 5:38 PM, Artyom Beilis <art...@ya...> wrote: > Can you explain what are you trying to do? > > > Artyom Beilis > > -------------- > > CppCMS - C++ Web Framework: http://cppcms.com/ > > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > -------------------------------------------- > On Wed, 12/4/13, Shiv Shankar Dayal <shi...@gm...> wrote: > > Subject: Re: [Cppcms-users] Caching files > To: cpp...@li... > Date: Wednesday, December 4, 2013, 2:01 PM > > I think web server nginx can > manage my case as it knows whether the request has to be > served with 200 or 304. I had another question, related to > async io, is most of the time network will be slow. SO > suppose I want to pause the file stream which is reading > into memory buffer so is there anyway to pause the reading > until what has been read and then restart the reading like > in Node.js or do I need to code it because I do not see this > in Doxygen documentation. > > > > On Wed, Dec 4, 2013 at > 5:19 PM, 陈抒 <csf...@gm...> > wrote: > > Hi, The way you mentioned can be called > as in-process cache. When we talking about > cache, there are a few kinds of cache technology, > in-process, out-of-process cache, local file cache, browser > cache. > > > For your case, you can cache these static files in > your app, or cache them with Nginx + Memcached/MongoDB. The > latter way does not need you to implement your cache > algorithm. Another way is to use in-process > & out-of-process cache together. Web servers cache files > in their process, but if the file is not found, it can load > it from remote cache server of database. > > > > > Dean Chen > Best regards > http://blog.csdn.net/csfreebird > > > On Wed, Dec 4, 2013 at 7:13 PM, Shiv > Shankar Dayal <shi...@gm...> > wrote: > > > > Hi, > > Suppose I am making few online game the clearly it is going > to involve some media. Let us say I have 2GB of artwork > which will remain constant. Is is not better that when the > application starts then load all these files in memory and > serve from there to users rather than putting them in > database and doing a caching. > > > > > > I think it is much better to load from raw filesystem > and keep then in memory in application and serve from there. > The only thing which is going to happen is when app will > start it will take time. But it is much better than async io > because we know how much data we have before hand and 2G or > something like even 10G data is not much as far as keeping > that in memory is concerned. > > > > > > Please note that this is static data will never change > so can be kept in const global buffers. Please share your > opinions. > > -- > > > Respect, > Shiv Shankar Dayal > > > > > ------------------------------------------------------------------------------ > > Sponsored by Intel(R) XDK > > Develop, test and display web and hybrid apps with a single > code base. > > Download it for free now! > > > http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk > _______________________________________________ > > > > > Cppcms-users mailing list > > Cpp...@li... > > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > > > ------------------------------------------------------------------------------ > > Sponsored by Intel(R) XDK > > Develop, test and display web and hybrid apps with a single > code base. > > Download it for free now! > > > http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk > _______________________________________________ > > > Cppcms-users mailing list > > Cpp...@li... > > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > > -- > Respect, > Shiv Shankar Dayal > > > -----Inline Attachment Follows----- > > > ------------------------------------------------------------------------------ > Sponsored by Intel(R) XDK > Develop, test and display web and hybrid apps with a single > code base. > Download it for free now! > > http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk > -----Inline Attachment Follows----- > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > ------------------------------------------------------------------------------ > Sponsored by Intel(R) XDK > Develop, test and display web and hybrid apps with a single code base. > Download it for free now! > > http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > -- Respect, Shiv Shankar Dayal |