Cache-control, Expires headers

I want JNLP files and JAR files to be cached by JNLP clients, but I want to prevent them from being cached in a browser / proxy server / ISP server of some sort (anything that would prevent the JNLP client from getting updates).
To stop a web page being cached I typically use the following:
response.setDateHeader("Expires", 1L);
// Set standard HTTP/1.1 no-cache headers.
response.setHeader(
"Cache-Control", "no-store, no-cache, must-revalidate");
// Set IE extended HTTP/1.1 no-cache headers (use addHeader).
response.addHeader("Cache-Control", "post-check=0, pre-check=0");
// HTTP 1.0 header
response.setHeader("Pragma", "no-cache");This works well in stopping caching of web-pages, and it doesn't stop the Sun Java Web Start client (JRE 1.5) from caching JNLP / JAR files (I don't think it's actually checking any of the above headers).
However, I have read that setting the above headers can cause problems. Does anyone know the official line on this? I couldn't find anything in the JNLP spec.
If it makes a difference, the app will be deployed only on JRE 1.4 or later.

LateNightMovies,
> Hi, thanks for your reply (and sorry for posting my
question
> twice)...
No worries. :)
> ** unfortunately, your solution doesn't work.
It's possible I didn't understand what you're after.
> My objective is to "not have the page stored" (saved) in
the
> cache (it contains data I don't want stored in client
browsers).
Aha. Nine times out of ten, when people say they want to
want to avoid
cacheing, what they mean is, "Get Flash to always ask for new
data," which
is what that blog entry describes. If it's important that the
data not be
cached at all....
> Adding a ? var - does ensure the page is always
retrieved
> from the server - but it still gets saved in the browser
cache.
Right.
> Eg. my url = page.asp?param=# (random number)
>
> The browser cache (Content.IE subdirectories) fill up
with
> files = page[1].html, page[2].html, page[3].html,....
Yup. Well, shoot. This question isn't something I can just
roll off
the top of my head, then. :-/ I should think that your HTML
header would
take care of that.
Are you appending the random number in your LoadVars method
calls? The
HTML page shouldn't be refreshing at all.
I know a few people I can ask for futher input, and I'll
report back to
this thread.
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/
"Luck is the residue of good design."

Similar Messages

  • HTTP Cache control / GZIP compression

    Hi,
    is it possible to add / enable cache control / compression in Connect Pro (7 or 8)? If so, how?
    I suspect we'll have to tweak the underlying http server for it but I'd like to know if this is documented somewhere and if it's supported. Especially, we'd like to
    - add / configure Cache-Control http headers
    - add / configure Expires http headers
    - activate GZIP/Deflate compression
    If this isn't something Connect offers out of the box, any recommendations for proxy servers to put in front of Connect and things to watch out for?
    Thanks,
    Dirk.

    Thanks. We solved it by adding a custom Servlet Filter to the web.xml.
    Dirk.

  • JRE Cache ignores the "Expire" and "Cache-Control: no-cache" directives.

    My applet is using HttpURLConection to retrieve data from a server with Caching enabled. The cache contents are "revalidated" (via "if-modfied-since") each time the applet is started. However, subsequent requests to retrieve the same resource are always read from the cache with no validation even if the resource has expired.
    The server is sending a valid "Expires:" tag and "Cache-Control: no-cache" tag in the response; but, the JRE refuses to recheck for an updated version of the resource even after the file has expired.
    The JRE does seem to understand the "Cache-Control: no-store" tag; but, this is inefficient (no caching at all) when I'm tring to get it to not refetch the resource unless there's a change. Is there some other tag that the JRE is expecting to see?

    I have a similar problem except that I want my pages to not cache at all. The server is setting the Cache-Control: max-age to 0 and the Expires to "now" but JRE seems to ignore these settings, but only sometimes. Sometimes pages are fetched from cache and sometimes from the server.
    In my applet I'm using a normal URLConnection like this:
    URLConnection uc = new URL("http://<server>/method").openConnection();
    uc.connect();
    InputStream is = uc.getInputStream();
    is.read();When my request headers look like this:
    accept-encoding: gzip
    Host: <server>
    Cache-Control: no-cache
    Pragma: no-cache
    User-Agent: Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_13
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Connection: keep-alivethe page will not be cached and is requested again but this time without the accept-encoding, Pragma and Cache-Control. The adding (and removal) of the headers seems to happen inside the JRE, though. I'm not explicitly setting them.
    The response header of the first request looks like this:
    HTTP/1.1 200 OK
    Date: Wed, 20 May 2009 12:55:07 GMT
    Server: Apache/2.2.11 (Win32) mod_jk/1.2.26 PHP/5.2.8
    Cache-Control: max-age=0
    Expires: Wed, 20 May 2009 12:55:07 GMT
    Vary: User-Agent,Accept-Encoding
    Content-Encoding: gzip
    Keep-Alive: timeout=120, max=79
    Connection: Keep-Alive
    Transfer-Encoding: chunked
    Content-Type: text/html;charset=iso-8859-1When the request is made with this header:
    User-Agent: Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_13
    Host: <server>
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Connection: keep-aliveThe response headers looks like this:
    HTTP/1.1 200 OK
    Date: Wed, 20 May 2009 12:55:07 GMT
    Server: Apache/2.2.11 (Win32) mod_jk/1.2.26 PHP/5.2.8
    Content-Length: 1016
    Cache-Control: max-age=0
    Expires: Wed, 20 May 2009 12:55:07 GMT
    Vary: User-Agent,Accept-Encoding
    Keep-Alive: timeout=120, max=83
    Connection: Keep-Alive
    Content-Type: text/html;charset=iso-8859-1And in this case the JRE sometimes fetches the request from the server and sometimes from cache. I have not been able to determine how the JRE decides to refresh, or why it sometimes sends an accept-encoding and Pragma header and sometimes not.
    any help would be appreciated.
    Alex

  • Can't propagate Cache-Control headers with Surrogate-Control header

    My application may set the following response header to cause webcache to process the esi:include's:
    Surrogate-Control: content=ORAESI/9.0.4, max-age=3600
    It and also may set the following intended for the browser cache:
    Cache-Control: private
    or say:
    Cache-Control: max-age=3600
    However Webcache removes this and always adds the following whenever surrogate-control has been set:
    Cache-Control: max-age=0
    This means I can't have browser caching and esi page compilation, just one or the other.
    This seems to be designed behaviour can someone explain why this is and if it can be worked around?
    I realise that the Cache-Control header should be ignored by webcache but why cant I propagate it to higher caches?

    Patrik,
    You'll need to convert the meta http-equiv tags into actual HTTP headers before sending for Web Cache to be able to parse it.

  • Controlling Cache-Control headers

    We have an application written in BC4J 9.0.3.4 riding atop 9iAS 9.0.3.1.0.
    The release notes for this version of 9iAS say
    2484551 Microsoft Internet Explorer cannot open some file directories due to HTTP NO-STORE header
    If users use Microsoft Internet Explorer 6.0.2600.0000, then they cannot open some attachments, such as Microsoft PowerPoint or voicemail directly. They have to save the file and open it from their file system. The file cannot be opened because Microsoft Internet Explorer 6.0 doesn't save the file to the <code>temp</code> folder when an HTTP no-store header is set.
    Saying that this is fixed is, to say the least, iffy. A packet dump clearly shows the following headers being set at some point after JSP filters get a chance to kick in (i.e., probably by mod_oc4j itself):
    Pragma: no-cache
    Cache-Control: no-store
    Surrogate-Control: no-store
    Cache-Control: private
    There doesn't seem to be any way of turning these headers off other than using .htaccess and mod_headers to explicitly delete them (which is definitely not ideal). Further, my tests indicate that these headers (probably only Cache-Control: no-store) prevent IE5.5 and IE6 both from launching external applications on the basis of Content-Type / extension, and from saving the page at all.
    This is, admittedly, a violation of RFC2616 on IE's part: that RFC states that no-store is meant to apply to intermediate proxies, not to user agents themselves. But nonetheless I think Oracle should at least allow pandering to this particular bug; i.e., even if Cache-Control: no-store is on by default, it should be possible to turn it off.
    Am I missing something? Is there any way to stop mod_oc4j adding these headers?

    I tried the brute-force approach:
    Header set Cache-Control: no-cache
    Header set Surrogate-Control: no-cache
    in .htaccess.
    Alas, .htaccess isn't being read, even with
    <Directory /oracle/product/ias_903/j2ee/OC4J_DEV/applications>
    AllowOverride FileInfo
    </Directory>
    in the httpd.conf.
    This is confusing. Does mod_oc4j somehow ban the processing of .htaccess files even if the AllowOverride says otherwise?

  • Disable Pagma and Cache-Control headers in SunOne WebServer 6.1

    Hi,
    I want the [Pragma] and [Cache-Control] headers completely disappear from SunOne WebServer 6.1 JSP responses (like the SunOne WebServer 6.0 SP8, http/1.1 but no [Pragma] and [Cache-Control] headers), can I achieve this?
    Thanks,
    Harry

    Hi Harry
    Do you mean that WebServer 6.0 SP8 provide a way to disable these two attributes? If so, that will be a regression issue for WS6..

  • Mozilla Firefox 32.0.1 caching objects without cache control headers

    Mozilla firefox is caching objects without any cache-control or expires header in response. The response does contain etag and date header but doesnt indicate anything about the duration it should be caching it. An example URL is https://www.priceless.com/content/dam/priceless/us/en/newyork/component/backgroundimages/NewYork_1920x596.jpg
    Am I missing something very obvious here.

    That is a beautiful picture. I understand that you are looking for a return header information about expiration. The about:cache page will show that information akaik there is a column information about expiration time. Some expire and some don't. I am pretty sure the later is the case you are seeing.

  • Prolem with Cache-Control:max-age http header

    Hello
    It seems that safari do not take into account Cache-Control:max-age=31536000 http header.
    Sending this header to the browser I would expect that safari will not ask the server for these resources before current date + one year.
    It's the way IE and FireFox are working but safari is asking the server for these resources every time my html page is loaded (see http requests below).
    Server returns a 304 status to indicate that the resource is not modified.
    Does somebody have an idea about this strange behaviour?
    I'm surprise that Safari do not respect RFC specifications.
    Is there a settings to enable Cache-Control ?
    Perhaps I forgot safari's specific headers..
    Thanks
    +GET 786+
    GET /xtend/htmrsrc/LIB/XtendAjaxScripts.js HTTP/1.1
    +RESP 786+
    HTTP/1.1 200 OK
    Server: Apache-Coyote/1.1
    Last-Modified: Wed, 15 Oct 2008 13:25:24 GMT
    *Cache-Control: PUBLIC, max-age=31536000, must-revalidate*
    *Expires: Thu, 05 Nov 2009 13:09:10 GMT*
    Content-Type: application/x-javascript;utf-8
    Content-Length: 2856
    Date: Wed, 05 Nov 2008 13:09:10 GMT
    +GET 799+
    GET /xtend/htmrsrc/LIB/XtendAjax.js HTTP/1.1
    If-Modified-Since: Fri, 24 Oct 2008 07:59:24 GMT
    +RESP 799+
    HTTP/1.1 304 Not modifed
    Server: Apache-Coyote/1.1
    Date: Wed, 05 Nov 2008 13:11:19 GMT

    This is a User to User forum, not a developer forum. You need to avail yourself of developer resources for this problem instead of posting them here.
    Mulder

  • Cache-control header

    I have an authenticated webapp with a servlet that send information back to the client browser that is not particularly sensitive. As such, I'd like for the client to be able to cache the retrieved data for a reasonable amount of time.
    Thus, I've added the following code to my servlet:
    long expireTime = System.currentTimeMillis() + (7 * 24 * 3600 * 1000); // Cache for one week
    response.setDateHeader("Expires", expireTime);
    response.setHeader("Pragma", "cache");
    response.setHeader("Cache-control", "public");While my expires header is indeed getting set to the date that I specify, AS7 is ignoring my Pragma header and sending two (!) Cache-control headers (as seen in a packet dump using ethereal):
    Hypertext Transfer Protocol
        HTTP/1.1 200 OK\r\n
        Server: Sun-Java-System-Application-Server/7 2004Q2\r\n
        Date: Sat, 23 Apr 2005 01:30:15 GMT\r\n
        Content-type: message/rfc822\r\n
        Expires: Sat, 30 Apr 2005 01:30:15 GMT\r\n
        Pragma: No-cache\r\n
        Content-disposition: attachment;filename=msg145206-11461.eml\r\n
        Cache-control: no-cache\r\n
        Cache-control: public\r\n
        Transfer-Encoding: chunked\r\n
        \r\n
        HTTP chunked responseAm I doing something wrong, or is this a bug in AS7?
    This is really causing a problem, because I want the browser to toss this data stream over to Outlook Express (the data is an e-mail message) but IE sees the no-cache header and refuses to write the file to disk, and thus, OE has no file to open.
    Thanks,
    Bill

    Oh, BTW we believe this header modification is happening because we are setting a cookie and so WLS sees this and adds its own header. Still, we don't want WLS to do anything with the headers.

  • Specific CACHE-CONTROL abilities?

    This may be more of an actual server setting, but I thought I
    would check and see if anyone came up with a way to do this through
    straight CF coding.
    On sites that require time-sensitive updates, we always use
    the CFHEADER and CACHE-CONTROL settings ... it works very well, but
    I am hoping to make this even more dynamic.
    When you use cache-control in its default format, it causes
    EVERYTHING on the page to not be cached and therefore reloaded.
    What I am wondering is if there is a way to code CACHE-CONTROL so
    it will still allow images to be cached, but not the actual HTML
    page code. Reloading images all the time is not always necessary
    and it would be nice to save bandwidth wherever possible.
    Since caching is done by the browser, I am surprised there is
    no way to specify what objects can be cached and what cannot with
    these tags; so I am hoping I am just overlooking something.
    Thanks in Advance.
    IIS6:Win2003:CFMX7

    This isn't really an answer, but you could try looking into
    serving the images from a different domain and setting cache
    headers on the web server, then for the page set different cache
    headers that expire immediately. Untested, Untried and just
    throwing it out there.
    ie
    http://images.mydomain.com
    http://www.mydomain.com
    I get the idea from Yahoo's YSlow plug in for firefox which
    rates the page, and one of the ratings is for CDN (Content Delivery
    Network), try googling that.
    Sorry can't be of any more specific help.

  • Reload previous page on back button - using cache control

    Hi,
    In my application I am using cache control to avoid the pages to be cached. But the requirement is changed and now the previous page can be re-loaded on hittinh browser's back button even after the 10 mins. i.e if user hits the back button with in 10 mins he should be allowed to see the pre-loaded contents on the previous page. After 10 mins the browser should display the page refresh warning.
    a) Old code to preventing caching:
    response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
    response.setHeader("Pragma","no-cache"); //HTTP 1.0     
    response.setDateHeader ("Expires", -1); //prevents caching at the proxy server
    b) I am trying with the code ha changes as to get the previous page with in 10 minutes time:
    response.setHeader("Cache-Control","no-cache, max-age=600"); //HTTP 1.1
    response.setHeader("Pragma","no-cache"); //HTTP 1.0     
    The above code changes are not working. If uses "no-cache" with max-arg=600 it behaves like the code in section a).
    If I uses response.setHeader("Cache-Control","max-age=600"); then even after 30 mins it load the previous page with preloaded contents.
    Any help is appreciated.

    I tried it lots of time by refreshing the browser's cache. I am using IE 6.0. I tested it through FireFox to get the header details. when I submit the request it displays the headers request
    same as I set in the code. But when I hit the back button (after the max age time passed) still it gets the value from cache and no header values are displayed.

  • Creating a cache control

    Has anyone created a cache control for Workshop?
    I'm wanting to cach the results of a complex report by using the xbean. Then if the request parameters match an already generated report, I simply send back out a pregenerated xbean.
    The cache would need a time expiration and max size handling.
    Thanks,
    Rodger Ball
    Sr. Software Architect
    Business Wire.

    If you have the option to use WLP, you can access the com.bea.p13n.cache APIs to write a Control that uses the portal cache functionality, which includes:
    * time-to-live (LRU removal), max size configuration
    * JMX based administration, including built-in admin from adminPortal and Workshop.
    * cluster aware flushing.
    Of course, if you can't or don't want to include portal, that won't work for you :)
    Greg
    Has anyone created a cache control for Workshop?
    I'm wanting to cach the results of a complex report
    by using the xbean. Then if the request parameters
    match an already generated report, I simply send back
    out a pregenerated xbean.
    The cache would need a time expiration and max size
    handling.
    Thanks,
    Rodger Ball
    Sr. Software Architect
    Business Wire.

  • No-cache not expiring web page

    In the below servlet A i am able to get the no cache to work so when i hit the back button the page is expired.
    I am using this same exact code in another servlet. The only differenc i can think of is the i am using the PRG patten with it. So i do a process then it redirects to servlet B and displays the invoice page. However if i hit back from here the page is not expired and will still display.
    any ideas?
    thanks john
    SERVLET A
    public class NewRegistration extends HttpServlet{
         public void doGet(HttpServletRequest request,
                   HttpServletResponse response)
         throws IOException, ServletException
              HttpSession session = request.getSession();
              User user = (User) session.getAttribute("user");      
              Cart cart = (Cart) session.getAttribute("cart");
              session.setAttribute("cart", cart);
              session.setAttribute("user", user);
              //session.setAttribute("Checked", "CHECKED");
              session.setAttribute("isChecked", "isChecked");
              response.setHeader("Pragma", "No-cache");
              response.setHeader("Cache-Control", "no-cache");
              response.setDateHeader("Expires", 1);
              String url = "/register.jsp";
              RequestDispatcher dispatcher =
                   getServletContext().getRequestDispatcher(url);
              dispatcher.forward(request, response);
         public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
         throws IOException, ServletException
              doGet(request, response);
    }SERVLET B
    public class DisplayInvoiceServlet extends HttpServlet
        public void doGet(HttpServletRequest request,
                HttpServletResponse response)
                throws IOException, ServletException
            HttpSession session = request.getSession();
             String Error = (String) session.getAttribute("Error");
             String processerror = (String) session.getAttribute("processerror");
                                    response.setHeader("Pragma", "No-cache");
              response.setHeader("Cache-Control", "no-cache");
              response.setDateHeader("Expires", 1);
              String url = "";
              if(Error !=null){
                   url = "/confirm.jsp";
                   session.setAttribute("Error", Error);
              else if(processerror != null){
                   session.setAttribute("processerror", processerror);
                   url = "/carderror.jsp";
              else{
                   url = "/invoice.jsp";     
            RequestDispatcher dispatcher =
                    getServletContext().getRequestDispatcher(url);
            dispatcher.forward(request, response);
         public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
         throws IOException, ServletException
              doGet(request, response);
    }

    The redirect in this servlet goes to servlet B. This is the servlet described in the first post that i didnt include.
    public class SubmitOrderServlet  extends HttpServlet
         public void doGet(HttpServletRequest request,
                   HttpServletResponse response)
         throws IOException, ServletException
              String cardType = request.getParameter("Ecom_Payment_Card_Type");
              String cardName = request.getParameter("Ecom_Payment_Card_Name");
              String cardNum = request.getParameter("Ecom_Payment_Card_Number");
              String expMonth = request.getParameter("Ecom_Payment_Card_ExpDate_Month");
              String expYear = request.getParameter("Ecom_Payment_Card_ExpDate_Year");
              String cvvCheck = request.getParameter("group2");
              String cvv2 = request.getParameter("Ecom_Payment_Card_Verification");
              String bankPhone = request.getParameter("bankphone");
              HttpSession session = request.getSession();
              User user = (User) session.getAttribute("user");    
              Cart cart = (Cart) session.getAttribute("cart");
              Icharge icharge = new Icharge();
              Cardvalidator validate = new Cardvalidator();
              GenericValidator validator = new GenericValidator();
              DecimalFormat format = new DecimalFormat("0.00");
              String Error = "";
              boolean proceede = true;
              try {
                   validate.reset();
                   if(cardType.equalsIgnoreCase("0")){
                        Error = "Please Select Card Type";
                        proceede = false;
                        session.setAttribute("Error", Error);
                   if(proceede){
                        if(!cardName.equalsIgnoreCase(user.getformatBName())){
                             Error = "Cardholder name must match billing Information";
                             proceede = false;
                             session.setAttribute("Error", Error);
                   if(proceede){
                        if(expMonth.equalsIgnoreCase("Month")){
                             Error = "Please Select Exp. Month";
                             proceede = false;
                             session.setAttribute("Error", Error);
                   if(proceede){
                        if(expYear.equalsIgnoreCase("Year")){
                             Error = "Please Select Exp. Year";
                             proceede = false;
                             session.setAttribute("Error", Error);
                   if(proceede){
                        if(expMonth != null && expMonth.length() >0 && !expMonth.equalsIgnoreCase("Month")){
                             validate.setCardExpMonth(Integer.parseInt(expMonth));
                   if(proceede){
                        if(expYear != null && expYear.length() >0 && !expYear.equalsIgnoreCase("Year")){
                             validate.setCardExpYear(Integer.parseInt(expYear));
                   if(proceede){
                        if(cvvCheck.equalsIgnoreCase("cscY")){
                             if(cvv2 == null || cvv2.equals("")){
                                  Error = "Please enter Card Security Code";
                                  proceede = false;
                                  session.setAttribute("Error", Error);
                             else if(cvv2 != null && (cvv2.length() < 3 || cvv2.length() > 4)){
                                  Error = "Please enter a valid Card Security Code";
                                  proceede = false;
                                  session.setAttribute("Error", Error);
                             else if(!validator.isInt(cvv2)){
                                  Error = "CSC must be numeric";
                                  proceede = false;
                                  session.setAttribute("Error", Error);
                   if(proceede){
                        if(bankPhone == null || bankPhone.equals("")){
                             Error = "Please enter issuing bank phone number";
                             proceede = false;
                             session.setAttribute("Error", Error);
                   if(proceede){
                        validate.setCardNumber(cardNum);
                        validate.validateCard();
                   if(proceede){
                        if(validate.isDateCheckPassed() && validate.isDigitCheckPassed()){
                             try{
                                  icharge.resetData();
                                  icharge.setGateway(1);
                                  icharge.setTransactionDesc("Ibiz Test Transaction");
                                  String total = cart.getTotalPrice();
                                  total = total.substring(1);
                                  icharge.setTransactionAmount(total);
                                  icharge.setCardCVV2Data(cvv2);
                                  icharge.setCardNumber(cardNum);
                                  icharge.setCardExpMonth(expMonth);
                                  icharge.setCardExpYear(expYear);
                                  icharge.setCustomerFirstName(user.getBillfirstName());
                                  icharge.setCustomerLastName(user.getBilllastName());
                                  icharge.setCustomerAddress(user.getBilladdress1());
                                  icharge.setCustomerCity(user.getBillcity());
                                  icharge.setCustomerState(user.getBillstate());
                                  icharge.setCustomerZip(user.getBillzip());
                                  //icharge.setInvoiceNumber("12345");
                                  icharge.setTimeout(30);
                                  icharge.authorize();
                                  if(icharge.isTransactionApproved()){
                                       session.setAttribute("processerror", null);
                                       System.out.println("AVS " +icharge.getResponseAVS());
                                       System.out.println("resp " +icharge.getResponseCode());
                                       System.out.println("cvv " +icharge.getResponseCVV2());
                                       //System.out.println("respD " +icharge.getResponseData());
                                       System.out.println("resptext " +icharge.getResponseText());
                                       System.out.println("transId " +icharge.getResponseTransactionId());
                                       System.out.println("apprCode " +icharge.getResponseApprovalCode());
                                       java.util.Date today = new java.util.Date();
                                       CCData cardData = new CCData();
                                       cardData.setAvsResp(icharge.getResponseAVS());
                                       cardData.setCardholder(user.getBillfirstName() + " " + user.getBilllastName());
                                       cardData.setCardNum(cardNum);
                                       cardData.setCardType(validate.getCardTypeDescription());
                                       cardData.setCvvResp(icharge.getResponseCVV2());
                                       cardData.setRespApprCode(icharge.getResponseApprovalCode());
                                       cardData.setRespText(icharge.getResponseText());
                                       cardData.setRespTransId(icharge.getResponseTransactionId());
                                       Invoice invoice = new Invoice();
                                       invoice.setUser(user);
                                       invoice.setInvoiceDate(today);
                                       invoice.setLineItems(cart.getItems());
                                       if(cart.getTax() > 0){
                                            invoice.setIsTax("Y");
                                            invoice.setTax(cart.getTax());
                                       else{
                                            invoice.setIsTax("N");
                                       invoice.setSubtotal(cart.getSubtotal());
                                       invoice .setTotal(Double.parseDouble(total));
                                       Tender tender = new Tender();
                                       tender.setAmount(Double.parseDouble(total));
                                       tender.setTenderType(validate.getCardTypeDescription());
                                       InvoiceDB.insert(invoice,cardData,tender);
                                       StringUtils strUtil = new StringUtils();
                                       String items = "";
                                       for(int i = 0; i < cart.getItems().size(); i++){
                                            LineItem item = cart.getItems().get(i);
                                            Product p = item.getProduct();
                                            items = strUtil.addToRecWSAftr(items, String.valueOf(item.getQuantity() + strUtil.fillRight(String.valueOf(p.getItemNum()),17)) +
                                                      strUtil.fillRight(p.getDesc2(),29) + strUtil.fillRight(String.valueOf(p.getPriceFormat()),12));
                                       // Send an email to the user to confirm the order.
                                       String to = user.getEmail();
                                       String from = "[email protected]";
                                       String subject = "Order Confirmation";
                                       String body = "Dear " + user.getFormatSName() + ",\n\n" +
                                       "Thanks for ordering from us. " +
                                       "You should receive your order in 3-5 business days. " +
                                       "Please contact us if you have any questions.\n\n" +
                                       "Order Summary\n\n" +
                                       "Qty          Item No.          Description            Price\n"+
                                       "-----------------------------------------------------------\n"+
                                       items + "\n";
                                       boolean isBodyHTML = false;
                                       try
                                            MailUtil.sendMail(to, from, "", subject, body, isBodyHTML);
                                       catch(MessagingException e)
                                            this.log(
                                                      "Unable to send email. \n" +
                                                      "You may need to configure your system as " +
                                                      "described in chapter 15. \n" +
                                                      "Here is the email you tried to send: \n" +
                                                      "=====================================\n" +
                                                      "TO: " + to + "\n" +
                                                      "FROM: " + from + "\n" +
                                                      "SUBJECT: " + subject + "\n" +
                                                      "\n" +
                                                      body + "\n\n");
                                       session.setAttribute("invoice", invoice);
                                  else{
                                       session.setAttribute("processerror", icharge.getResponseText());
                                       System.out.println("resptext " +icharge.getResponseText());
                                       System.out.println("resp " +icharge.getResponseCode());
                                       System.out.println("respD " +icharge.getResponseData());
                             catch(IBizPayException ex){
                                  System.out.println("IPWorks exception thrown: " + ex.getCode() + " [" + ex.getMessage() + "].");
                             catch(Exception ex){
                                  System.out.println(ex.getMessage());
                        else{
                             proceede = false;
              catch (IBizPayException ex) {
                   Error = ex.getMessage();
                   proceede = false;
                   session.setAttribute("Error", Error);
              catch (Exception e1) {
                   System.out.println(e1.getMessage());
              if(!proceede){
                   session.setAttribute("cardI", cardType);
                   session.setAttribute("expmI", expMonth);
                   session.setAttribute("expyI", expYear);
                   session.setAttribute("cardN", cardNum);
                   session.setAttribute("cvv", cvv2);
                   session.setAttribute("bphone", bankPhone);
              else{
                   session.setAttribute("cardI", null);
                   session.setAttribute("expmI", null);
                   session.setAttribute("expyI", null);
                   session.setAttribute("cardN", null);
                   session.setAttribute("cvv", null);
                   session.setAttribute("bphone", null);
                   session.setAttribute("Error", null);
              response.setHeader("Pragma", "No-cache");
              response.setHeader("Cache-Control", "no-cache");
              response.setDateHeader("Expires", 1);
              response.sendRedirect("DisplayInvoice");
         public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
         throws ServletException, IOException
              doGet(request, response);
    }

  • Cache control directives in iPlanet 4.1 (SunOS 5.7)

    Using the admin gui (Content Mgmt->Cache Control Directives), I set the cache control to "No Cache" for the entire server; however, clients still seem to cache pages from the server (IE6 on winxp does not go to the server for pages it has seen before). I looked at the response headers using wget on solaris (as well as wfetch on winxp), and I don't see the Cache-Control header. Here is what I get back after requesting a page from the server:
    HTTP/1.1 200 OK
    Server: Netscape-Enterprise/4.1
    Date: Wed, 31 Dec 2003 14:01:13 GMT
    Content-type: text/html
    Content-length: 120
    Connection: keep-alive
    I restarted the server, and the admin gui shows the correct ("No Cache") setting for the server.
    Thanks in advance for any ideas on how to get the server to ask the client not to cache the pages.

    Can you show us your obj.conf file?
    Thanks
    Manish

  • Cache-Control and Accept-Encoding support in Adobe AIR HTML Component

    I am evaluating Adobe AIR's HTML component and trying to figure out what is supported.
    I built the AIR app and had it point to www.google.com
    I notice that the requests to fetch JS,CSS from Adobe AIR do not include Accept-Encoding: gzip header.
    Does Adobe AIR's HTML Component support Accept-Encoding : gzip header ?
    I also noticed that even though the content served with far futures expiry, i.e. has Cache-Control: maxage={value} subsequent requests are being made and content is not served from the browser's cache.
    I observed this accross the app restarts.
    Can someone please clarify support of the two above Http headers ?
    Thank you.
    -Prashant

    You might also want to check out the useCache property to see if this helps.  See these links:
    http://forums.adobe.com/thread/726573
    http://forums.adobe.com/thread/490497
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/html/HTMLLoader.h tml

Maybe you are looking for