Standard Servlet caching mechanism

Gurus,
Is there any standards on caching servlet reponse. Most of the application servers provide their own mechanism to cache servlet response.
I am looking for application server netural standards for caching servlet resposne. If there is no standards for caching available in any of the servlet > 2 releases, probably i would send an email to servlet specification guys to think on something like this.
Its lot of pain when you write code in some server and deploy it on some other server where the servlet caching response caching is suported.
Any help in this will be appreciated

Here is more explanation...
Suppose for an example, a servlet that accepts parameter(s) and queries the database and displays a html text, may be around 100 records. ok?
Next time when you make the same request with same set of parameters, the servlet excecutes the db query again and display the same result when it was intially called.
Now my question, is there standard mechanism to cache the servlet reponse at server side and when the request is made with same set of parameters, it would be served from the cache instead of making db call.
In addition to that, it should work under all the application server when you deploy
Let me know if this clear enough, or i can add more stuff in here.

Similar Messages

  • Servlet caching in oc4j/orion

    I'm making changes to my servlet yet they do not seem to be getting picked up, even when I restart orion. I have my classes, jsp etc in a war file under applications. Is there a servlet caching issue here and if so how do i solve it. I noticed an earlier posting about classes needing to be in a jar file to get reloaded, is something similar required for servlets?
    Neil W.

    Neil,
    If you are in the development stage of your application probably you will not like to go thru the hastle of building the WAR each time your servlet or JSP is changed. Please look at the following link to how to deploy apps with Exploded Directory Format http://otn.oracle.com/docs/tech/java/oc4j/htdocs/getstart.htm#1027810. In this case each time your apps is changed you just change the timestamp on web.xml by either UNIX touch command or some other mechanism and OC4J will redeploy your new apps.
    regards
    Debu Panda
    Oracle

  • Hi, I developed a web application using HTML5-Offline Application Cache mechanism. Inspite of deleting the cache as mentioned in the above steps, Firefox still maintains a copy of the page in it's cache. Also, a serious bug is, even though we delete all

    == Issue
    ==
    I have a problem with my bookmarks, cookies, history or settings
    == Description
    ==
    Hi,
    I developed a web application using HTML5-Offline Application Cache mechanism. Inspite of deleting the cache as mentioned in the above steps, Firefox still maintains a copy of the page in it's cache. Also, a serious bug is, even though we delete all temp files used by Firefox, and open the previously cached page, it displays it correctly, but upon refreshing/reloading it again shows the previous version of the page maintained in the cache.
    == Troubleshooting information
    ==
    HTML5: Application Caching
    .style1 {
    font-family: Consolas;
    font-size: small;
    text-align: left;
    margin-left: 80px;
    function onCacheChecking(e)
    printOutput("CHECKINGContents of the manifest are being checked.", 0);
    function onCacheCached(e) {
    printOutput("CACHEDAll the resources mentioned in the manifest have been downloaded", 0);
    function onCacheNoUpdate(e)
    printOutput("NOUPDATEManifest file has not been changed. No updates took place.", 0);
    function onCacheUpdateReady(e)
    printOutput("UPDATEREADYChanges have been made to manifest file, and were downloaded.", 0);
    function onCacheError(e) {
    printOutput("ERRORAn error occured while trying to process manifest file.", 0);
    function onCacheObselete(e)
    printOutput("OBSOLETEEither the manifest file has been deleted or renamed at the source", 0);
    function onCacheDownloading(e) {
    printOutput("DOWNLOADINGDownloading resources into local cache.", 0);
    function onCacheProgress(e) {
    printOutput("PROGRESSDownload in process.", 0);
    function printOutput(statusMessages, howToTell)
    * Outputs information about an event with its description
    * @param statusMessages The message string to be displayed that describes the event
    * @param howToTell Specifies if the output is to be written onto document(0) or alert(1) or both(2)
    try {
    if (howToTell == 2) {
    document.getElementById("stat").innerHTML += statusMessages;
    window.alert(statusMessages);
    else if (howToTell == 0) {
    document.getElementById("stat").innerHTML += statusMessages;
    else if (howToTell == 1) {
    window.alert(statusMessages);
    catch (IOExceptionOutput) {
    window.alert(IOExceptionOutput);
    function initiateCaching()
    var ONLY_DOC = 0;
    var ONLY_ALERT = 1;
    var BOTH_DOC_ALERT = 2;
    try
    if (window.applicationCache)
    var appcache = window.applicationCache;
    printOutput("BROWSER COMPATIBILITYSUCCESS!! AppCache works on this browser.", 0);
    appcache.addEventListener('checking', onCacheChecking, false);
    appcache.addEventListener('cached', onCacheCached, false);
    appcache.addEventListener('noupdate', onCacheNoUpdate, false);
    appcache.addEventListener('downloading', onCacheDownloading, false);
    appcache.addEventListener('progress', onCacheProgress, false);
    appcache.addEventListener('updateready', onCacheUpdateReady, false);
    appcache.addEventListener('error', onCacheError, false);
    appcache.addEventListener('obsolete', onCacheObselete, false);
    else
    document.getElementById("stat").innerHTML = "Failure! I cant work.";
    catch (UnknownError)
    window.alert('Internet Explorer does not support Application Caching yet.\nPlease run me on Safari or Firefox browsers\n\n');
    stat.innerHTML = "Failure! I cant work.";
    == Firefox version
    ==
    3.6.3
    == Operating system
    ==
    Windows XP
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729; .NET4.0E)
    == Plugins installed
    ==
    *-Shockwave Flash 10.0 r45
    *Default Plug-in
    *Adobe PDF Plug-In For Firefox and Netscape "9.3.2"
    *NPRuntime Script Plug-in Library for Java(TM) Deploy
    *The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
    *Google Update
    *4.0.50524.0
    *Office Live Update v1.4
    *NPWLPG
    *Windows Presentation Foundation (WPF) plug-in for Mozilla browsers
    *Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
    *Npdsplay dll
    *DRM Store Netscape Plugin
    *DRM Netscape Network Object
    Thanks & Regards,
    Kandarpa Chandrasekhar Omkar
    Software Engineer
    Wipro Technologies
    Bangalore.
    [email protected]
    [email protected]

    We have had this issue many, many times before including on the latest 3.6 rev. It appears that when the applicationCache has an update triggered by a new manifest file, the browser may still use only its local network cache to check for updates to the files in the manifest, instead of forcing an HTTP request and revalidating both the browser cache and the applicationCache versions of the cached file (seems there is more than one). I have to assume this is a browser bug, as one should not have to frig with server Cache-Control headers and such to get this to work as expected (and even then it still doesn't sometimes).
    The only thing that seems to fix the problem is setting network.http.use-cache to false (default is true) in about:config . This helps my case because we only ever run offline (applicationCache driven) apps in the affected browser (our managed mobile apps platform), but it will otherwise slow down your browser experience considerably.

  • How to build cache mechanism

    Hello all
    i have application that basically loading very big object that contains sub objects and
    doing dynamic lookup by name of the object and the method i like to invoke and then invoke it
    everything done ofcorce with reflection .
    now this application will be called handeret times per minute .
    some questions .
    first of all do i need caching mechanism? for saving the subobject that had bean called in some kind of vector in memory for example or if i use reflection , i dont need caching mechanism .
    second question is do i need threads here ? if i do , how i buid some kind of locks to this threads ?
    thanks

    I'd use the Flyweight pattern here. It sounds like you're retrieving a lot of data that's related to other data through some kind of index. A Data Transfer Object (DTO) is a Flyweight class that could hold all of the information required to retrieve the "sub-objects" as you call them, but not until they're needed. It's a little more detailed to make sure that the objects are available when you need them, but obviously the network bandwidth/latency issues are causing a severe performance impact. I'm using EJBs in this example, but it will apply to anything where large amounts of related data are used in the application.
    // EJB Entity bean
    public abstract class EJBEntity extends EJBObject {
        public abstract Integer getId();
        public abstract String getStringData();
        public abstract Collection getChildObjects(); // "heavyweight" data
    // Data Transfer Object
    public class EJBEntityDTO {
       private int id;
       private String stringData;
       private int[] childIds;
    // some application code
    id = ...
    EJBEntityDTO dto = transferEJBData(id);
    EJBEntityDTO childDTO = transferEJBData(dto.childIds[0]);
    ...It's definitely more work to do it this way, but it's the only way to avoid fetching the entire collection when you only need one child object.
    Brian

  • What is the caching mechanism firefox 3.6 uses compared to what IE 6/7 and 8/9 use?

    I just need to know how firefox handles/takes care of/and does its work with cookies and cache, basically its caching mechanism. Also comparing it to IE versions 6/7 and 8/9 would help, for the sake of web development with respect to the two browsers (Detailed technical answer would help). Since web apps may sometimes work on firefox and sometimes not while it works in IE just fine.

    Hi Kellymarr,
    You can take a look at the release notes for each version to see what has been added or fixed:
    http://www.mozilla.org/en-US/firefox/4.0/releasenotes/
    Just change the version number in the url to see each major release.
    Hopefully this helps!

  • Suitable Caching Mechanism

    Apoplogies if this is the wrong newsgroup. My J2EE App runs on Weblogic 8.1 and uses Oracle 9. It involves processing at times up to 50000 database records at a go. The Application applies an algorithm to each database record and then writes it's results to an output table which has a one to one mapping with the input table i.e I will be inserting about 50000 records. In order to improve performance I want to use JDBC batch inserts, however each output record is produced by a MDB (Message Driven Bean) from a pool.I guess I need a sort of cacheing mechanism which holds the records from the MDBs and some business logic to apply the JDBC batch insert to a chunk of the cache. I will probably need a timed event to perform this "flushing" of the cache periodically. Anybody have experience of doing something similar or able to provide a more elegant solution to the problem?
    TIA

    Hi Sailendra,
    In this case you can make use of BPM object if I understood your question correctly.
    In the component Cataloge make a BPM object and under that create attribute/attributes/array. Then the value you want to save/store keep it in a bpm object attribue and pass the bpm object from one process layer to another/as per your requirement. ex: bpmobject.attribute1Name = "Bibhu";
    You can acccess those values in another process/activities by bpmobject.attributeName
    bpmobject is the object that you created and the instance variable is of type created bpmobject.
    attributeName is the attribute where you stored the value.
    Regards
    Bibhu

  • Servlet caching ????

    I input a name to a servlet and try to print out something with that name.Say , for ex. I enter "Bryan" and the output wud be "Bryan belongs to section C"
    when 2 or more users enter names from different machines using the same servlet at the same time..sometimes it happens that they dont get the result with what they gave in, instead one gets output with the name another enterted.
    To make it more clear..
    Suppose C1 enters "Adam" as input to the servlet to get an output "Adam belongs to Section C "
    C2 enters "Lisa" as input to the servlet to get an output "Lisa belongs to Section C "
    C3 enters "Ted" as input to the servlet to get an output "Ted belongs to Section C "
    What happens sometimes is that when C1, C2,C3 enter their value at the same time, C2 and C3 get "Adam belongs to Section C " instead of "Lisa belongs to Section C " and "Ted belongs to Section C "
    When can such a thing happen?? Does servlet cache in the server??
    How come the value gets passed on to the other requests as well..
    Any help is appreciated..

    Are you using class level or object level variables in your Servlet class to store the user entered values? (Use only local variables unless you really know what you are doing).
    Are you using ServletContext attributes?
    As far as I know, except for these two scenarios, there is no other way that requests will share values.

  • Prevent servlet caching

    I am having problem with servlet caching. My Servlet keeps displaying
    previously cached image instead of an updated image. I tried out the
    following workarounds and was not successful.
    1. Set the following Response headers
    res.setDateHeader("Expires", 0);
    res.setHeader("Cache-Control", "no-store, no-cache, must-revalidate,
    post-
    check=0, pre-check=0");
    res.setHeader("Pragma", "no-cache");
    2. Set HTML META TAG:
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="0">
    Has anyone experienced a similar issue and can you share your
    worarounds. I even tried setting DateHeader as follows but no luck.
    res.setDateHeader("expires", System.currentTimeMillis()).
    thanks in advace

    And is this servlet actually sending the image itself, or it is sending some HTML that contains a link to the image? If it's the latter, then no amount of saying not to cache the HTML will have any effect on whether browsers cache the linked image.
    Actually now that I read your post more carefully, I see that you are sending HTML which presumably has an <img> tag referring to the image. The browser will download that image as a separate transaction. But if you change the date on the image file to something later, the browser should stop caching it.

  • I want to know the caching mechanism of Firefox

    Hi everyone,
    i want to know how exactly caching mechanism works in firefox? I know for the cached objects we have two info
    Expire date or Max-age, how we use them while deciding if the object should be served from cache or not

    You neither described the problem you actually had nor the version you had. There may be other solutions such as described in the following answer which also tells you how to go back to to any version
    https://support.mozilla.com/questions/840344
    You can make Firefox 4.0.1 and '''Firefox 5.0''' look like Firefox 3.6.17, see numbered items 1-10 in the following topic [http://dmcritchie.mvps.org/firefox/firefox-problems.htm#fx4interface Fix Firefox 4.0 toolbar user interface, problems (Make Firefox 4.0 look like 3.6)]

  • JNDI as a caching mechanism

    Hi,
    We are building an application using stateless session beans to access some
    back end systems. The backend transaction is rather expensive with regards
    to execute time. To optimize response times we are looking at a caching
    strategy, we have identfied the following implementation alternatives :
    1. Create object cache implementations as statefull session beans, storing a
    reference to them in JNDI.
    2. Create object cache implementations as regular java objects and storing
    the entire object in JNDI.
    Which one of these alternatives we choose will rely on the performance of
    the WL JNDI, we are using the 5.1 server. If WL JNDI is capable of handling
    reasonable amounts of data there should be no reason to use the expensive
    statefull session beans.
    Q1 : Are there any method to calculate the amount and troughput of data that
    would be possible using alternative 2 ?
    Q2 : Are there any other mechanism we should consider ?
    Any help would be greatly appreciated
    Regards,
    Anders Mathisen

    Read-Only entity beans are the entity beans which never call ejbStore() and
    ejbLoad() is only called when timeout is expired (or never).
    If you want to cache data for the session only you can use HttpSession - in
    the cluster all requests are pinned to the server which originated the session
    until this server fails. To minimize replication overhead you can use transient
    fields or use the fact that replication happens only when session attribute is
    set() - you can associate a cache object with the session and lazy populate it
    later.
    Anders Mathisen <[email protected]> wrote:
    hi,
    thanks for the response, what do you mean by read-only entity beans ?
    Beans that are loaded with data manually (from eg. a stateless session
    bean), and just used as a dataholder ?
    I forgot to mention in the previous article that the caching mechanism here
    needs only be local to a single users session. That is a session will never
    use cached data from another session.
    Althoug even if we have the requirement above, some caching mechanism
    allowing for sharing of data could be handy here, this is not an absolute
    requirement.
    Anders M.
    Rob Woollen <[email protected]> skrev i
    meldingsnyheter:[email protected]...
    Stateful session beans should not normally be used as a cache. A
    stateful session bean instance is associated with a single user.
    I wouldn't use JNDI as a caching mechanism either.
    My suggestion would be Read-Only entity beans.
    -- Rob
    Anders Mathisen wrote:
    Hi,
    We are building an application using stateless session beans to access
    some
    back end systems. The backend transaction is rather expensive withregards
    to execute time. To optimize response times we are looking at a caching
    strategy, we have identfied the following implementation alternatives :
    1. Create object cache implementations as statefull session beans,storing a
    reference to them in JNDI.
    2. Create object cache implementations as regular java objects andstoring
    the entire object in JNDI.
    Which one of these alternatives we choose will rely on the performanceof
    the WL JNDI, we are using the 5.1 server. If WL JNDI is capable ofhandling
    reasonable amounts of data there should be no reason to use theexpensive
    statefull session beans.
    Q1 : Are there any method to calculate the amount and troughput of datathat
    would be possible using alternative 2 ?
    Q2 : Are there any other mechanism we should consider ?
    Any help would be greatly appreciated
    Regards,
    Anders Mathisen--
    Coming Soon: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnweblogic.com
    Dimitri

  • Are there internal caching mechanism

    I recognized in my tests, that the response time of the IMDB Cache getting faster after serveral execution of the same SQL Command.
    Are there internal request caching mechanism? What ist the name of these functions?

    The TimesTen database maintains a cache of prepared SQL statements which is known as the command cache. Whenever a statement is prepared we first check to see if the statement already exists in the cache and if so we will use the existing cached plan rather than do a full prepare. This is similar to soft versus hard parse in the Oracle database.
    There are some builtin procedures that allow you to examine the contents of this cache; look in the TimesTen Database reference guide at the builtins that start with ttSQLCmd...
    Chris

  • On Caching Mechanism

    Hello All,
    We have implemented a caching mechanism using UET table. It is working fine whenever database tables get updated.
    My Question is:
    If we are viewing a report on the Dashboard at the same if the database tables get updated, Is it compulsion to press the Refresh button on the Dashboard to reflect the changes?
    We are thinking that if we traverse other tabs or other dashboards and coming back to the report which we are viewing will reflect the changes because now it will issue the SQL to the database rather getting the data from Cache as it is purged by cache mechanism.
    Is our assumption is wrong because we unable to see the updated data?
    -Vency

    Hi mma,
    As you suggested, we have checked 'Bypass Oracle BI Presentation Services Cache' and any changes to database reflecting on to dashboards without pressing refresh button.
    But, doing so , BI Presentation Server issuing SQL everytime rather selecting it from Cache, as we disable it. So, it is taking time everytime viewing the Reports on the Dashboard.
    Do we have any mechanism to purge the Presentation Services Cache manually like we do for BI Server cache at the time of updating database tables?
    Thanks,
    -Vency

  • Caching mechanism in OBPM

    HI ,
    Does OBPM have any caching mechanism(build in API) to store data .I have some data to be used in one of the process.I can't not connect to the external DB because my OBPM don't have a direct connection to external DB.Only way is queue.Every Time I can't post request in queue to get this data.
    Please help me
    Thanks
    Sailendra

    Hi Sailendra,
    In this case you can make use of BPM object if I understood your question correctly.
    In the component Cataloge make a BPM object and under that create attribute/attributes/array. Then the value you want to save/store keep it in a bpm object attribue and pass the bpm object from one process layer to another/as per your requirement. ex: bpmobject.attribute1Name = "Bibhu";
    You can acccess those values in another process/activities by bpmobject.attributeName
    bpmobject is the object that you created and the instance variable is of type created bpmobject.
    attributeName is the attribute where you stored the value.
    Regards
    Bibhu

  • Calling non standard servlet methods

    How can we call the non standard servlet methods like OPTIONS, HEAD, TRACE, etc.? Like to call the GET method of the servlet located on server xyz from some HTML page, we write the HTML form as follows :
    <form name="frmname" action="http://xyz.com/servlet/MyServlet" "method=get">
    So what should we write to call the other methods?
    Ankit.

    You can't do it directly from HTML, you need to open a connection over HTTP and then send the appropriate HTTP request. Not all web servers support these methods.

  • Decument about buffer cache mechanism

    hi gurus
    I want some documentations about the buffer cache internal mechanism,for example the internal structure of the buffer cache,how does the buffer cache works and the LRU mechanism.The more detailed the better.
    I have searched on Oracle Documentation Linrary with buffer head or buffer descriptor as keywords.I did not get what i want.
    many thanks in advance.

    Hi Kevin,
    I believe information which you are looking is not published by Oracle and is avaialable only to Oracle Support and other employees. You can refer to Note:62172.1 for buffer cache mechanism. It mentioned about a note with "@" in beginning meaning the remark was supposed to be unpublished.
    "@ See Note 104937.1 for a description "
    May be the above note has got some description. Anyways I will suggest you to go through the Note:62172.1 and get basic understanding which should be sufficient for dba's.
    Cheers
    Amit

Maybe you are looking for

  • Blank Virtual Consoles

    I have a similar problem to https://bbs.archlinux.org/viewtopic.php - 1#p1245351 . Once I start X, my virtual consoles become invisible, though I can access them by typing blindly. I have used systemd for a long time. When I boot my virtual console a

  • Unsanity related blue screen of death

    I decided to post this as a separate thread from the ongoing blue screen of death, as that thread seems to be mostly related to those upgrading to Leopard. My situation is slightly different. There appears to be two separate issues related to this bl

  • Data entry- bom component qty in decimals

    Hi, We need to enter bom component qty with 4 decimal places like 9.0001 mm etc. as the table field structure is set as 3 for decimal places, it is not allowing to enter. Also tried with su01 as well as cuni settings. Please advise is there any way t

  • Why are Siri searches not private when private browsing in Safari?

    When private browsing is enabled in Safari, searches done with Siri still show up in the "recent searches" menu of the search box. Is this a bug? Or is there a way to prevent "Siri searches" from showing up in the recent searches list? This does not

  • Problèmes de photos...BB CURVE 3G

    Bonjour à tous, Lorsque je prends des photos, elles n'apparraissent plus dans mon dossier "images", ni dans les archives. Par contre, dès que je me connecte sur mon PC, les images sont visibles. Je ne trouve pas la manipulation à faire pour que mes p