[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: Far Future Expiration Headers of Assets
From:       Harry Zhou <superharry () gmail ! com>
Date:       2014-12-22 21:01:18
Message-ID: CAB0rDDz=JPLo1wW8DEC=jQh_edA7VyesFJsnBrasqr6E2CrE8g () mail ! gmail ! com
[Download RAW message or body]

Hi George,

It does sound like the same issue.

Regarding the "leverage browser caching" warning, I did not "solve"
the problem -- it appears to be a false alarm by Chrome PageSpeed: (i)
if one keeps the Chrome developer panel up and click around in a
Tapestry webapp, one should see that the assets are indeed cached
after the initial round of full requests ("200 from cache" will be
shown for cached assets).  No requests for these assets will actually
be sent to server unless the user clicks the refresh button or run an
audit with page reload from Chrome PageSpeed.  The latter case is
where PageSpeed will complain about the assets, because although it
sees the 10-year-in-the-future headers in the responses, which Chrome
does honor and will cache accordingly, PageSpeed will, however, want
to see a "Cache-Control" header in responses.  It is likely a
non-issue because during ordinary browsing client caching is
leveraged.

The 60 seconds for modules are discussed here:
http://tapestry.apache.org/javascript-modules.html

"By default, Tapestry sets a max age of 60 (seconds) on modules, so
you won't see module requests on every page load. This is configurable
and you may want a much higher value in production. If you are rapidly
iterating on the source of a module, you may need to force the browser
to reload after clearing local cache. Chrome has an option to disable
the client-side cache when its developer tools are open."

The page lists solutions as well.

Harry







On Mon, Dec 22, 2014 at 12:44 PM, George Christman
<gchristman@cardaddy.com> wrote:
> I'm having this same issue which I posted up a couple weeks ago
> without any response.
> http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/5-4-asset-expire-header-td5729478.html
>  
> So my first question is what did you do to resolve the issue?
> 
> Secondly I am running in production mode, so I'm not sure what the
> cause could be. I'll have to check the cdn, but this is what google is
> complaining about. The images are being called from a sprite map in
> css where the context binding prefix can't be used.
> 
> Leverage browser caching
> 
> Setting an expiry date or a maximum age in the HTTP headers for static
> resources instructs the browser to load previously downloaded
> resources from local disk rather than over the network.
> Leverage browser caching for the following cacheable resources:
> 
> https://d39chrhoz7kxwa.cloudfront.net/1f1a90de-ed5_300.jpg (expiration
> not specified)
> https://d39chrhoz7kxwa.cloudfront.net/29fb2b34-55d_300.jpg (expiration
> not specified)
> https://d39chrhoz7kxwa.cloudfront.net/3902d130-3b1_300.jpg (expiration
> not specified)
> https://d39chrhoz7kxwa.cloudfront.net/75713aa2-bec_300.jpg (expiration
> not specified)
> https://www.cardaddy.com/modules.gz/autocomplete-custom.js (60 seconds)
> https://www.cardaddy.com/modules.gz/bootstrap/collapse.js (60 seconds)
> https://www.cardaddy.com/modules.gz/bootstrap/dropdown.js (60 seconds)
> https://www.cardaddy.com/modules.gz/bootstrap/transition.js (60 seconds)
> https://www.cardaddy.com/modules.gz/t5/core/messages/en_US.js (60 seconds)
> https://www.cardaddy.com/modules.gz/t5/core/select.js (60 seconds)
> https://www.cardaddy.com/modules.gz/t5/core/zone.js (60 seconds)
> 
> Any thoughts?
> 
> On Sun, Dec 21, 2014 at 5:14 PM, Harry Zhou <superharry@gmail.com> wrote:
> > Hi Bob and Thiago, thank you for pointing me to the right direction!
> > Problem solved.
> > 
> > It is NOT Tapestry related: Chrome's PageSpeed audit tool chooses to
> > ignore Tapestry's 10-year-in-the-future "Expires" response header.
> > But during actual browsing the assets are actually cached (seeing "200
> > from cache").
> > 
> > Google seems to take the position that "Expires" response headers are
> > "superseded."  While Chrome honors "Expires" during browsing, it will
> > also look for a "Cache-Control" in response headers.  See
> > https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching#cache-control
> >  
> > 
> > On Sun, Dec 21, 2014 at 2:54 PM, Thiago H de Paula Figueiredo
> > <thiagohp@gmail.com> wrote:
> > > Another thing to check: production mode is off?
> > > 
> > > 
> > > On Sun, 21 Dec 2014 17:34:39 -0200, Bob Harner <bobharner@gmail.com> wrote:
> > > 
> > > > Be sure production mode is on and that your links to the asset are using
> > > > the asset: or context: binding prefix.
> > > > 
> > > > Can you give us a typical asset URL (as seen by the browser)? That might
> > > > give us some hints.
> > > > 
> > > > Also be sure the expires headers aren't being removed by a proxy or CDN.
> > > > Hint: doest the issue happen on your desktop with local host, or only when
> > > > running on a server?
> > > > On Dec 21, 2014 11:55 AM, "Harry Zhou" <superharry@gmail.com> wrote:
> > > > 
> > > > > Hi!
> > > > > 
> > > > > About my T5.4 site, Google is complaining that "resources are missing
> > > > > a cache expiration. Resources that do not specify an expiration may
> > > > > not be cached by browsers . . . "
> > > > > 
> > > > > I read that "assets get a far-future expires header" and will be
> > > > > "client browsers will aggressively cache downloaded assets."  So I am
> > > > > not sure why responses for my assets all come with
> > > > > "Cache-Control:no-cache" and "Pragma:no-cache".
> > > > > 
> > > > > Any help would be appreciated.  Thanks!
> > > > > 
> > > > > Best Regards
> > > > > Harry
> > > > > 
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > > > 
> > > > > 
> > > 
> > > 
> > > --
> > > Thiago H. de Paula Figueiredo
> > > Tapestry, Java and Hibernate consultant and developer
> > > http://machina.com.br
> > > 
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > 
> > 
> > 
> > 
> > --
> > Best Regards
> > Harry Zhou
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> > 
> 
> 
> 
> --
> George Christman
> CEO
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 



-- 
Best Regards
    Harry Zhou

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic