You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org> on 2006/05/26 18:14:30 UTC

[jira] Resolved: (TAPESTRY-955) Expires header not set correctly in AssetService

     [ http://issues.apache.org/jira/browse/TAPESTRY-955?page=all ]
     
Jesse Kuhnert resolved TAPESTRY-955:
------------------------------------

    Fix Version: 4.1
     Resolution: Fixed

Fix applied, thank you.

> Expires header not set correctly in AssetService
> ------------------------------------------------
>
>          Key: TAPESTRY-955
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-955
>      Project: Tapestry
>         Type: Bug

>   Components: Framework
>     Versions: 4.1
>     Reporter: Marcel Juffermans
>     Assignee: Jesse Kuhnert
>     Priority: Minor
>      Fix For: 4.1

>
> The AssetService sets the Expires header to control caching. The duration is calculated by the following lines of code:
> /**
> * Time vended assets expire. Since a change in asset content is a change in asset URI, we want
> * them to not expire ... but a year will do.
> */
> private final long _expireTime = _startupTime + 365 * 24 * 60 * 60 * 1000;
> However, this causes a numeric overflow, resulting in an expiry in the order of about a month instead of a year. This means that browser clients will start issuing (unnecessary) conditional requests about a month after a Tapestry application is deployed, leading to unnecessary overhead.
> The correct code is:
> private final long _expireTime = _startupTime + 365 * 24 * 60 * 60 * 1000L;
> (notice the final "L"). However, I'd argue to make the period longer, for example 10 years:
> private final long _expireTime = _startupTime + 10 * 365 * 24 * 60 * 60 * 1000L;
> Regards,
> Marcel

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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