Caching Query Image Stream

Currently I am working on a CMS of sorts and the higher-ups
wanted to have some digital asset management capibilities. All
images are now being stored in SQL2k5 in binary form. On a page
that contains the image, I have a the image
src="myImageLoader.cfm?imageId=x" where x is the id of the image to
load.
This all works fine, however if the user returns to a page
that they have previously visited, the image is not cached and must
restream out. Any ideas on how to cache the image after it has been
streamed?

The only smart way to do this is to write the image out as a
regular file and link to that.
Caching, handshaking, and compression are then handled
beautifully by the web server and client browser.
The only thing you would (possibly) need to do is to run a
job every few days to clean out stale (or access limited) files.
Otherwise, you will need to set the "last modified" and
"expires" headers and to monitor for and process the
"If-Modified-Since" header.

Similar Messages

  • Not enough bytes in image stream

    Hi
    I'm developing a program that reads/modifies/saves PDF files. I found a strange imagestream in the PDFReference Document:
    2385 0 obj
    <</Length 255/Filter /FlateDecode/Width 155/Height 76/BitsPerComponent 8/ColorSpace 36619 0 R/Type /XObject/Subtype /Image>>
    stream
    [Binary Data]
    endstream
    endobj
    36619 0 obj
    [/Indexed /DeviceCMYK 153 2378 0 R]
    endobj
    2378 0 obj
    <</Length 264/Filter/FlateDecode>>
    stream
    [Binary Data]
    endstream
    endobj
    The decoded stream of object 2385 is 5080 bytes long.
    The decodes stream of object 2378 is 616 bytes long.
    Strange:
    Height/Width*BitsPerComponent = 76*155*8 = 94240 bits = 11780 bytes!
    The length of the stream is only 5080 bytes long.
    Aren´t there to less bytes for the image?
    Or did i misunderstand something?
    PDF viewers can display this PDF correctly, so there must be something I dont know...
    What is the secret?
    Thanks for your help!

    I've found the error now. It was my FlateDecode algorythm which had a too small buffer for some streams, which had a very good compression rate. So they were cut. There aren´t much streams which such a compression rate, so I didn´t realize this a long time.
    Thanks anyway!
    Have a good day!

  • Caching Query Issues?

    I have a test(on the server) and a development(localhost) sites so is the oracle database schemas.  Both Oracle database schemas reside on the same server. I have the same datasource name for both schemas in the CF Administrators (local and server). For some reason, it seems to me that the data being pulled only from the test environment database eventhough I run the code on the development(localhost).  I cleared the cache on the CF administrator.   Any advise would be great.  Thanks.

    Soumen Mondal,
    If you are facing this problem from the same client PC and in the same session, it's very strange.. but if there are two sessions running on the same PC this kind of issue may come..
    Something about caching:
    To decide whether to cache a query or not, consider the number of times you intend to run the query in a minute. For data changing in seconds, and queried in minutes, I would recommend not to cache query at all.
    I may give a typical example for query caching in a query on material master cached for 24 hours, where we know that after creating material master, we are not creating a PO on the same day.
    BR,
    SB

  • Take photo from image stream using capture engine technique in media foundation

    Hi,
    I am beginner for media foundation.I have to develop Win32 desktop application using capture engine technique in media foundation.
    I have to implement the following features:1)Show video streaming 2)Capture video 3)Capture photo from still-image stream.These features are implemented in capture engine.
    I am able to take photo from video stream not from image stream.I tried to configure the image stream index in Addstream() api,but its giving MF_CAPTURE_ENGINE_ERROR error.
    To trigger the still pin,use
    the IAMVideoControl::SetMode method
    in directshow. How do i implement this feature using capture engine technique in MF?My question
    is-is it possible do it in Media foundtion??I have searched many sites but no luck.
    Here the sample code which i used to capture an image.
    HRESULT TakePhoto()
    HRESULT hr = m_pEngine->GetSink(MF_CAPTURE_ENGINE_SINK_TYPE_PHOTO, &pSink);
    if (FAILED(hr))
    goto done;
    hr = pSink->QueryInterface(IID_PPV_ARGS(&pPhoto));
    if (FAILED(hr))
    goto done;
    hr = m_pEngine->GetSource(&pSource);
    if (FAILED(hr))
    goto done;
    hr = pSource->GetCurrentDeviceMediaType(1, &pMediaType); // 1 is Image stream index.I will get current image stream media type here.
    if (FAILED(hr))
    goto done;
    //Configure the photo format
    hr = CreatePhotoMediaType(pMediaType, &pMediaType2,GUID_ContainerFormatBmp);
    if (FAILED(hr))
    goto done;
    hr = pPhoto->RemoveAllStreams();
    if (FAILED(hr))
    goto done;
    DWORD dwSinkStreamIndex;
    // Try to connect the first still image stream to the photo sink
    if(bHasPhotoStream)
    hr = pPhoto->AddStream((DWORD)MF_CAPTURE_ENGINE_PREFERRED_SOURCE_STREAM_FOR_PHOTO, pMediaType2, NULL, &dwSinkStreamIndex); //Instead of MF_CAPTURE_ENGINE_PREFERRED_SOURCE_STREAM_FOR_PHOTO,i gave index as 1.i am getting error
    if(FAILED(hr))
    goto done;
    hr = pPhoto->SetOutputFileName(pszFileName);
    if (FAILED(hr))
    goto done;
    hr = m_pEngine->TakePhoto();
    if (FAILED(hr))
    goto done;
    return hr;
    HRESULT OnCaptureEvent(WPARAM wParam, LPARAM lParam)
    GUID guidType;
    HRESULT hrStatus;
    IMFMediaEvent *pEvent = reinterpret_cast<IMFMediaEvent*>(wParam);
    hr = pEvent->GetExtendedType(&guidType);
    if (SUCCEEDED(hr))
    if (guidType == MF_CAPTURE_ENGINE_ERROR) //i got this error if i give dwSourceStreamIndex as '1' in Addstresm api
    DestroyCaptureEngine();
    pEvent->Release();
    return hrStatus;
    Please help me to solve this problem.Past one week,I am working on this issue and i couldnt find the solution.Please give me a some idea or some sample code to solve this problem.
    Thanks in advance.
    Regards,
    Ambika

    Hi Everyone,
    Any help will be appreciated.
    Regards
    Ambika

  • Cannot query using both conforming and cached query result

    TopLink doesn't allow me to both use conforming and cached query result at the same time.
    Conforming is certainly not a superset of the [cached query result] features.
    Can you confirm that it's a limitation of TopLink?
    Any know workaround to end-up with the same features as using both conforming and cached query result?
    Conforming is about seeing modifications you do in the same transaction. As a bonus, if you query for one object and specify at least the id as criteria because TopLink will have to check in memory anyway it can avoid going to the database.
    But if I do a query like "give me employees hired before now and after 30 days ago" it's about more than one objects and about finding existance so cached query result is needed to get acceptable performance in a complex application trying to avoid the same SQL generated over and over again.

    Thats where the trace just ends? It doesnt look like there's any LIKE or filtering going on (with respect to the Oracle pieces anyway), apparently MSAccess simply requested the whole table.
    What do you mean by 'hang' exactly? Are you sure it's just not taking a long time to complete? How long have you waited? How fast does it complete on the other environment?
    ODBC tracing isnt likely to help much for that. SQLNet tracing would be better to see what is going on at a lower level. Specifically, what is going on at the network level? Is the client waiting for a packet to be returned from the database?
    Is the database having a hard time processing the query, perhaps due to index/tuning issues?
    Assuming that is indeed the query that is "hung", how much data does that return?
    Are you able to reproduce the same behavior with that query and vbscript for example?
    Greg

  • Sharing/Caching (Dynamic) Images

    I find that the Flash Player does not cache dynamic images
    (even in the same session), so my question is, how would I share
    images across multiple image components such that I can build an
    asset provider of sorts to assit with caching images and other
    assets?
    I've tried a simplistic approach where in I assign the source
    of one image component to another but then the first image
    component goes blank and the image "transfers" to the second.
    Not sure if BitmapData will help with this either.
    Any help/direction is much appreciated.
    Thanks.
    Shiv.

    URL? Code?
    Nancy Gill
    Adobe Community Expert
    Author: Dreamweaver 8 e-book for the DMX Zone
    Co-Author: Dreamweaver MX: Instant Troubleshooter (August,
    2003)
    Technical Editor: Dreamweaver CS3: The Missing Manual,
    DMX 2004: The Complete Reference, DMX 2004: A Beginner's
    Guide
    Mastering Macromedia Contribute
    Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP
    Web Development
    "kidcobra" <[email protected]> wrote in
    message
    news:g2oqb0$bgq$[email protected]..
    > PHP, dynamic images from mysql dbase....diplay on local
    server, but will
    > only
    > display on web server if in the same level or folder as
    the php page.
    > Locally,
    > I have put the path to the images in the dbase in front
    of the URL of the
    > image, and all works fine.... but with that path in
    there and images not
    > in
    > same folder as page, no web server display. I know I'm
    missing the
    > obvious, but
    > need help if anyone has the simple answer . Thanks
    >

  • cache-query-results question

    I have another post for general descriptor tag information but I do have a specific question. In a project I am looking at I see:
    <cache-usage> check cache by primary key </cache-usage>
    <cache-query-results>false</cache-query-results>
    <maintain-cache>true</maintain-cache>
    I'm not sure how to interpret this. Does this mean that a cache is in place or not? cache-query-rests is set to false which implies no caching, yet the other parameters imply a cache is in place. What overrides here?
    Thanks

    The XML maps directly to the API so the JavaDocs and related documentation are the best tools:
    cache-usage: query.setCacheUsage(int)
    This option indicates how the object cache should be used when processing the query. This is how in-memory query is configured as well as support for cache-hits on ReadObjectQuery.
    cache-query-result: query.setShouldCacheQueryResults(boolean)
    This option allows you to indicate that the results returned from the query execution should be held. When the query is executed again these results will be returned without going to the database or searching the object cache. This is just caching the results locally within the query.
    maintain-cache: query.maintainCache() or query.dontMaintainCache()
    This setting determines if the results returned from the query should be cached in the shared object cache. It is on by default and turning this off is very rare. Occasionally done to compare the cache version with the database verision when handling an optimistic locking failure.
    Doug

  • Does Apple TV Cache What It Streams?

    My TV Shows and movies that I encoded at 1900kbps skip so much that they're unwatchable. Even if I press pause for several seconds they will continue to skip after I press play again, which leads me to believe AppleTV is not caching what it streams. I have a wireless g network and tested this with nothing running on my iMac and nothing running on the network.
    I thought fine, I'll go buy an Airport N, but that would be pointless because my iMac can only stream G.
    My library is 200gb so what's a boy to do?

    Not necessarily. Remember that each device is talking to the access point independently of the other. The problem might well be the quality of the connection between the Apple TV and the access point. Also, depending on your physical layout, you might be able to use a wired connection with either your iMac or Apple TV.
    Another option is Ethernet over power lines. I'm using the Netgear HDX 101 with my Apple TV so that I don't have to worry about wireless performance.
    Also, are you sure that you are not having interference problems with your wireless network. While there are lots of channels, only 1, 6, and 11 don't overlap so you want to use the one with the least interference from neighbors.

  • Is it possible to stop APEX using a cached query?

    I was hoping that the issue where report regions sometimes show the error: "ORA-06502: PL/SQL: numeric or value error: NULL index table key value" would be fixed in 3.1.1 however it seems not to have been (We have had it several times now). The workaround seems to be to change the query slightly such as selecting NULL as an additional column and then hiding that column.
    This obviously only works AFTER the issue has occured, ie, after we have received a complaint from someone!
    Is it possible to stop APEX using the cached version of some queries altogether? The ones we are calling are quite simple and so will not give that much overhead.
    Thanks.

    I've actually found several threads on this from the past:
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value
    http://kr.forums.oracle.com/forums/thread.jspa?threadID=644172&tstart=120 (This thread states the problem has been fixed however it would appear either it hasn't or there is a similar bug elsewhere.)

  • 2 HD laptop setup - Best place to put Catalog, Cache, and Images??

    If I have two 500GB 7200rpm hard drives in my MBP, what is the best place for LR3, the catalog/previews, ACRcache, and the image files themselves?
    SATA3 connection for both HDs
    Should the boot drive hold the app and cache, while the second drive hold the files and catalog?
    Should the catalog and cache always stay on the same drive?
    Does it matter at all where the image (raw) files sit?
    Thanks!!

    I'd just keep the images on a different drive with a 2 internal drive setup.

  • Caching Query in Portal - Variable set to System Current Date

    Hi,
    I am facing issue on caching for query in portal in Production. I have query called ABC in production with variable Master valid on for user to chooce the date. This variable is hardcoded value in General Precalculation in variable assigment session. Eg. If i run OLAP Cache today then it will hardcoded to 18.9.2008. I cannot change the production query to set to System current date unless I use new technical name for any changes eg XYZ.
    Can i use different technical name for query in portal eg. XYZ in order to capture master valid default to today date ? I will do Broadcaster - OLA Cache for XYZ and does it also cache for ABC (query in portal)
    The purpose of caching is to happen to query ABC in portal. Please advise.
    PY

    name_in gets the value of the item. So you should use copy.
    copy('',:system.current_block||'.'||:system.current_item)

  • Best way to save images streamed from web to device?

    We have an app for browsing a catalog that streams content from a web server. There is an image for each product, some in JPG format and some in PNG format. Our server is fast and reliable so everything has been running smoothly so far, but we'd like to give users the option of saving the data to their device so they don't have to stream every time. I've only worked with SharedObjects before, which are capped at 100kb and won't be useful in this situation.
    What would be the best approach for storing the images, and keeping them from being overwritten during updates? Saving an uncompressed Bitmap will use too much storage space. Adobe's JPEGEncoder class is completely useless as it takes 10-30 seconds to save a moderately-sized image on a typical device. It also doesn't make sense to re-encode the JPGs, and we need to preserve the transparency in the PNGs.
    Right now we're using a Loader to retrieve the images and using loader.content to access the image data in code. Is it possible to save the image file in its original format locally when it is downloaded with a Loader? We would want the images stored in the application data and not accessible through the gallery. As for saving the data for each product (e.g. price, description, etc), would the built-in SQLite support be sufficient or should we create our own files?
    Thanks for any tips!

    We typically use a native extension to do this, but it is certainly possible in ActionScript.
    When the file has been downloaded, we save it to the applicationStorageDirectory.
    Next time, we check to see if exists locally, if so - use that and don't download.
       var file:String = renameFile(_externalHttpImage);
       //see if we already have a copy of the image
       var loader:Loader = new Loader();
       var ba:ByteArray = new ByteArray();
       if( fileExists(file)){
        file = File.applicationStorageDirectory.resolvePath(file).nativePath;
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, local_loader_complete);
        loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorOnChargeFile);
        var f:File = File.applicationStorageDirectory.resolvePath(file);
        if( f.exists){
         var fs:FileStream;
         try {
          //now load the size of the file
          fs = new FileStream();
          fs.open(f, FileMode.READ);
          fs.readBytes(ba);
          //  trace("READ " + fs.readUTF());
          fs.close();
         catch(e:Error){
          trace( "Error Loading Image File  '" +file + ": " +  e.message+ "\n"+ e.getStackTrace());
        loader.loadBytes(ba);

  • Mail Not Caching Loaded Images

    Running Leopard and Mail 3.1 with multiple IMAP accounts:
    So I like Mail's ability to NOT load images when I first view an email... it's a great way to avoid massive amounts of junk mail. My problem exists when I've told Mail that I DO want to load the images... they aren't being cached. So if I quickly view an email... load the images... jump to another email... then try to come back to the first one... none of the images are still there. Requiring me to reload them.
    Is anyone else experiencing this? Am I missing a setting somewhere? It seems to me that these images should be cached by Mail somewhere on my machine so that I don't have to load them every time I view an email.

    Bump again. I can't seem to get Mail to load inline images no matter what I do. Mayday.
    -K

  • PDF 1.2 Filter for a wmf image stream

    Does anybody know how to embed a wmf image as a stream in the PDF 1.2? I saw a filter for jpeg but it's not what I need. Thanks in advance!

    Thanks for your reply!

  • Coherence cache query - distinct

    Hi,
    I am trying to find out how to do a distinct query in coherence cache. For example, if my key object has LastName, FirstName. How do I get the collection of keys of distinct last names? In another words, I am trying to find out what are the distinct Last names in the cache. Is there any filter can be used to do that?
    Thanks.

    Hi,
    You can use DistinctValues aggregator.
    http://download.oracle.com/docs/cd/E14526_01/coh.350/e14977/toc.htm
    Wei
    Edited by: welin on Jun 10, 2010 8:38 AM

Maybe you are looking for

  • IPod Touch 4g stuck in recovery mode after iso 5.0 upgrade attempt

    Sorry that I'm late to the party and too stupid not to know better when updating my ipod touch just days after the update was released, when will I learn. I have tried nearly everything I've seen posted in this community and others ... unpluging all

  • CD Mix Project

    I am completely new to audio development on the MAC. My employer has set me up Logic Pro and Final Cut Pro which includes Soundtrack. To accommodate myself with my new tools and environment I am doing a simple mixing project that will include taking

  • Plant to Plant Stock Transfer

    Hi, I want to do stock Transfer from one Plant to another Plant in the same company. Pls. tell me about the process & the configuation needs to be done. Regards,

  • How to check the opening period

    Hi, During MRP run,the selection 2 Purchase requisitions in opening period. How system determine when is the opening period and propose for PR? Thank you

  • JSF and JSTL integration

    Can anyone tell me how to access JSF objects from JSTL tags? I want to set a requestScope flag in my changeListener ... context.getExternalContext().getRequestMap().put("xxx","ok"); ... and render output depending on existance of this flag: ...<c:if