Alpha Video Training
Results 1 to 5 of 5

Thread: Help on setting of Response Headers on A5V11

  1. #1
    Member
    Real Name
    Richard
    Join Date
    Jan 2011
    Location
    FL, USA
    Posts
    51

    Default Help on setting of Response Headers on A5V11

    Currently my response headers look like this:


    Response Headers:

    HTTP/1.1 200 OK
    Last-Modified: Sat, 05 May 2012 01:19:50 GMT
    Accept-Ranges: none
    Server: Alpha Five Application Server/11.0 Build/2549-3903
    Content-Type: image/jpeg
    Set-Cookie: A5WSessionId=c63ed3622b32405f8ee6251631e12a10; HttpOnly; path=/
    Via: HTTP/1.1 GWA
    Date: Mon, 07 May 2012 22:14:10 GMT
    Expires: Mon, 07 May 2012 22:14:10 GMT
    Cache-Control: max-age=600
    Transfer-Encoding: chunked
    X-XSS-Protection: 1; mode=block


    I need to change the Expires and Cache-Control values to enable caching of static images.
    I know I can set the values for the A5W files with Response.Headers.Set, but how do I do it for JPG files?

    Seems this must be done on some server settings, but where/which are they?

    I would appreciate any help.
    Thank you.
    Rich

  2. #2
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,699

    Default Re: Help on setting of Response Headers on A5V11

    The Cache-Control and Expires headers are not being set by the Application Server, which provides no way to do so. I see you have Google Web Accelerator in the mix, which is probably added those headers. You should look there for control over the values being used.

    Quote Originally Posted by richatal5soft View Post
    Currently my response headers look like this:


    Response Headers:

    HTTP/1.1 200 OK
    Last-Modified: Sat, 05 May 2012 01:19:50 GMT
    Accept-Ranges: none
    Server: Alpha Five Application Server/11.0 Build/2549-3903
    Content-Type: image/jpeg
    Set-Cookie: A5WSessionId=c63ed3622b32405f8ee6251631e12a10; HttpOnly; path=/
    Via: HTTP/1.1 GWA
    Date: Mon, 07 May 2012 22:14:10 GMT
    Expires: Mon, 07 May 2012 22:14:10 GMT
    Cache-Control: max-age=600
    Transfer-Encoding: chunked
    X-XSS-Protection: 1; mode=block


    I need to change the Expires and Cache-Control values to enable caching of static images.
    I know I can set the values for the A5W files with Response.Headers.Set, but how do I do it for JPG files?

    Seems this must be done on some server settings, but where/which are they?

    I would appreciate any help.
    Thank you.
    Rich

    Lenny Forziati
    Vice President, Internet Products and Technical Services
    Alpha Software Corporation

  3. #3
    Member
    Real Name
    Richard
    Join Date
    Jan 2011
    Location
    FL, USA
    Posts
    51

    Default Re: Help on setting of Response Headers on A5V11

    Thank you for the reply.

    I'm doing performance testing using http://www.webpagetest.org and those headers came from them.

    Using web-sniffer.net I get this:

    Status: HTTP/1.1 200 OK
    Last-Modified: Wed, 08 Feb 2012 14:05:40 GMT
    Connection: Close
    Accept-Ranges: none
    Date: Tue, 08 May 2012 20:46:50 GMT
    Server: Alpha Five/11.0 Build/2549-3903
    Content-Length: 40718
    Content-Type: image/jpeg
    Set-Cookie: A5WSessionId=dd29c479652940578584da1dc7428981; HttpOnly; path=/


    the Application Server, which provides no way to do so.
    Does this mean A5V11 Application Server has no way of setting response headers for Content-Type: image/jpeg?
    If so do you know of any other way in combination with the App server?

    Our application has many static images which are loaded in a looping paged image slider.
    Caching them would make a huge difference in terms of performance and traffic.

    Apache has the module 'mod_expires'. Any plans for A5 to "add" something similar?


    Rich

  4. #4
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,699

    Default Re: Help on setting of Response Headers on A5V11

    Quote Originally Posted by richatal5soft View Post
    Does this mean A5V11 Application Server has no way of setting response headers for Content-Type: image/jpeg?
    If so do you know of any other way in combination with the App server?

    Our application has many static images which are loaded in a looping paged image slider.
    Caching them would make a huge difference in terms of performance and traffic.

    Apache has the module 'mod_expires'. Any plans for A5 to "add" something similar?
    That's correct, you cannot set Response headers on purely static resources. We are not planning to add this functionality directly to the Application Server, as this will be available when running under IIS with our future integration.

    Until then, a couple of options come to mind: use an A5W page to serve the resources, or use a different server (IIS/Apache) to serve static resources.

    To server images using an A5W page, change you links to something like image.a5w?ImageName=image1.jpg. Then create image.5aw with something like
    Code:
    <%a5
    Response.Expire("30 days")
    Response.Headers.Set("CacheControl","max-age=9999")
    Response.SendFile(Request.ApplicationRoot + "\images\\" + ImageName)
    %>
    Using a different server, with a distinct host name, has several application performance advantages as well. In addition to freeing up the Application Server to concentrate on dynamic requests, it enables browsers to download more resources in parallel.

    Lenny Forziati
    Vice President, Internet Products and Technical Services
    Alpha Software Corporation

  5. #5
    Member
    Real Name
    Richard
    Join Date
    Jan 2011
    Location
    FL, USA
    Posts
    51

    Default Re: Help on setting of Response Headers on A5V11

    Thanks again. Those are great tips.

    We had thought of the A5V11/ IIS integration (were actually about to ask ZH about it), but we did not know it was not yet available.
    Using a different host will be our current choice, eventually going to a CDN.

    Many thanks.

Similar Threads

  1. Cannot create new database in A5V11
    By psuwan in forum Alpha Five Version 11 - Desktop Applications
    Replies: 5
    Last Post: 11-08-2011, 04:03 AM
  2. error: Response.headers[] subelement not found
    By drgarytraub in forum Application Server Version 9 - Web/Browser Applications
    Replies: 0
    Last Post: 12-04-2008, 08:36 AM
  3. Response Headers - force file download
    By David Brown in forum Application Server Version 8
    Replies: 2
    Last Post: 11-29-2007, 11:48 AM
  4. Strange response setting index
    By James Gatton in forum Alpha Five Version 1
    Replies: 2
    Last Post: 09-14-2001, 09:53 AM
  5. Setting a year response
    By Lucy Wolford in forum Alpha Five Version 4
    Replies: 3
    Last Post: 05-31-2000, 10:37 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •