You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Marcel Juffermans (JIRA)" <ta...@jakarta.apache.org> on 2006/05/22 03:50:29 UTC

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

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
    Priority: Minor


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


Re: Is there a way to speed up startup?

Posted by Henri Dupre <he...@gmail.com>.
On 5/23/06, jone <jo...@yahoo.com.cn> wrote:
>
> Henri Dupre <henri.dupre <at> gmail.com> writes:
>
> > We hardly restart our website (tomcat) so startup time doesn't really
> > matter... manageability/scalability/performance matter much more for us.
> >
>
> If there were 100 web APP based on hivemind and tapestry 4.x put in one
> tomcat,what would be happend? Is still tomcat alive?


I'm not sure to understand what you mean. Is your startup time issue linked
to a large number of web app based on hivemind and tapestry4?

I think you need to be more specific about your goals... Most web apps are
designed to have a fast user response often in detriment of the startup
time... Focusing on the startup time impacts quite a bit the design (e.g.
java client VM vs java server VM).

Thanks,

Henri.

Re: Is there a way to speed up startup?

Posted by Jesse Kuhnert <jk...@gmail.com>.
Serializable not implemented? Well goodness you really must have hit upon
something there.

Please take this to jira in the form of a patch. Otherwise it's just a bunch
of noise.

On 5/23/06, jone <jo...@yahoo.com.cn> wrote:
>
> Henri Dupre <henri.dupre <at> gmail.com> writes:
>
> > We hardly restart our website (tomcat) so startup time doesn't really
> > matter... manageability/scalability/performance matter much more for us.
> >
>
> If there were 100 web APP based on hivemind and tapestry 4.x put in one
> tomcat,what would be happend? Is still tomcat alive?
>
> Now I just have to face the problem,and I cannot find any idea to get them
> solved up to now.Anybody help me?
>
> Just now I take a glance at the TemplateSourceImpl, it seems that no way
> to
> serialize the cached elements,the interface "Serializable" is not
> implemented.My god.
>
> Thanks in advance about any idea. ^-^
> jone.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.

RE: Is there a way to speed up startup?

Posted by James Carman <ja...@carmanconsulting.com>.
Jone,

What exactly is it that you're trying to do?

James

-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of jone
Sent: Tuesday, May 23, 2006 8:29 AM
To: dev@tapestry.apache.org
Subject: Re: Is there a way to speed up startup?

Henri Dupre <henri.dupre <at> gmail.com> writes:

 > We hardly restart our website (tomcat) so startup time doesn't really
> matter... manageability/scalability/performance matter much more for us.
> 

If there were 100 web APP based on hivemind and tapestry 4.x put in one 
tomcat,what would be happend? Is still tomcat alive? 

Now I just have to face the problem,and I cannot find any idea to get them 
solved up to now.Anybody help me?

Just now I take a glance at the TemplateSourceImpl, it seems that no way to 
serialize the cached elements,the interface "Serializable" is not 
implemented.My god.

Thanks in advance about any idea. ^-^
jone.





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



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


Re: Is there a way to speed up startup?

Posted by jone <jo...@yahoo.com.cn>.
Henri Dupre <henri.dupre <at> gmail.com> writes:

 > We hardly restart our website (tomcat) so startup time doesn't really
> matter... manageability/scalability/performance matter much more for us.
> 

If there were 100 web APP based on hivemind and tapestry 4.x put in one 
tomcat,what would be happend? Is still tomcat alive? 

Now I just have to face the problem,and I cannot find any idea to get them 
solved up to now.Anybody help me?

Just now I take a glance at the TemplateSourceImpl, it seems that no way to 
serialize the cached elements,the interface "Serializable" is not 
implemented.My god.

Thanks in advance about any idea. ^-^
jone.





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


Re: Is there a way to speed up startup?

Posted by Henri Dupre <he...@gmail.com>.
On 5/22/06, jone <jo...@yahoo.com.cn> wrote:
>
> Just because of much start time taken ,no propry serialization solution
> for
> SessionFactory,heavy resource hold,Hibernate has been removed from my
> app.In
> fact,I'v been use hibernte since 1.x,but even about its latest CR2 ,still
> the
> performance is not high,and extensibility is bad.


Startup time is not a major factor for most web sites I believe.
And I disagree on performance and extensibility, the hibernate overhead is
very low compared to direct database access.




Now PHP has take a much progress,why?Just it's high speed,high
> efficiency,low
> resource hold ,etc.



I very much disagree on this statement. PHP has very poor scalability (no
clustering), and resource management. There is no central resources in php
for a single application/website except the database and filesystem.

Btw, what kind of application are you developing where startup time is so
important?
We hardly restart our website (tomcat) so startup time doesn't really
matter... manageability/scalability/performance matter much more for us.

Henri.

RE: Re: Is there a way to speed up startup?

Posted by Mark Stang <ms...@pingidentity.com>.
If you don't like hivemind, 3.x doesn't use it.


-----Original Message-----
From: news on behalf of jone
Sent: Mon 5/22/2006 5:32 PM
To: dev@tapestry.apache.org
Subject:  Re: Is there a way to speed up startup?
 
Just because of much start time taken ,no propry serialization solution for 
SessionFactory,heavy resource hold,Hibernate has been removed from my app.In 
fact,I'v been use hibernte since 1.x,but even about its latest CR2 ,still the 
performance is not high,and extensibility is bad.

In my opinion,web framework SHOULD be much more light-weight,robust,fast and 
less dependencies!

And what about hivemind,Besides it's much time taken on startup 
time,the "duplicated module hivemind" exception  is occasionally occured
(Actually there are no duplicated hivemind-xxxx.jar),and the worst is that I 
cannot get any idea to solve the problem!As a result,many user rejected me!

I think,the page and component serialization sulution is very important,It 
would be one active way to do.But,I don't know how to do!Give me help please.

Now PHP has take a much progress,why?Just it's high speed,high efficiency,low 
resource hold ,etc.

jone.




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



Re: Is there a way to speed up startup?

Posted by jone <jo...@yahoo.com.cn>.
Just because of much start time taken ,no propry serialization solution for 
SessionFactory,heavy resource hold,Hibernate has been removed from my app.In 
fact,I'v been use hibernte since 1.x,but even about its latest CR2 ,still the 
performance is not high,and extensibility is bad.

In my opinion,web framework SHOULD be much more light-weight,robust,fast and 
less dependencies!

And what about hivemind,Besides it's much time taken on startup 
time,the "duplicated module hivemind" exception  is occasionally occured
(Actually there are no duplicated hivemind-xxxx.jar),and the worst is that I 
cannot get any idea to solve the problem!As a result,many user rejected me!

I think,the page and component serialization sulution is very important,It 
would be one active way to do.But,I don't know how to do!Give me help please.

Now PHP has take a much progress,why?Just it's high speed,high efficiency,low 
resource hold ,etc.

jone.




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


Re: Is there a way to speed up startup?

Posted by Henri Dupre <he...@gmail.com>.
Do you have other frameworks like hibernate involved? They might take much
more time than tapestry...

Also I'm not sure what you mean by "Remove hivemind dependency"?


On 5/21/06, jone <jo...@yahoo.com.cn> wrote:
>
> hi,all
>
> Every time I startup my app based tapestry 4.x,It always spend much time
> on
> startup and page/component's loading!
>
> I think there are at least two way to solve:
>
> 1.Remove hivemind dependency.
> 2.Serialize the parsed page and component.
>
> but,how can do?Could somebody give me a hand.
> (I'am regret my poor Enlish.)
> thans
> jone
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Thanks,

Henri.

Re: Is there a way to speed up startup?

Posted by Ron Piterman <rp...@gmx.net>.
buy a better machine :)

Ron


jone wrote:
> hi,all
> 
> Every time I startup my app based tapestry 4.x,It always spend much time on 
> startup and page/component's loading!
> 
> I think there are at least two way to solve: 
> 
> 1.Remove hivemind dependency.
> 2.Serialize the parsed page and component.
> 
> but,how can do?Could somebody give me a hand.
> (I'am regret my poor Enlish.)
> thans 
> jone


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


Re: Is there a way to speed up startup?

Posted by Jesse Kuhnert <jk...@gmail.com>.
If you submit a patch to JIRA for it I'll be happy to take a look.

On 5/21/06, jone <jo...@yahoo.com.cn> wrote:
>
> hi,all
>
> Every time I startup my app based tapestry 4.x,It always spend much time
> on
> startup and page/component's loading!
>
> I think there are at least two way to solve:
>
> 1.Remove hivemind dependency.
> 2.Serialize the parsed page and component.
>
> but,how can do?Could somebody give me a hand.
> (I'am regret my poor Enlish.)
> thans
> jone
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.

Is there a way to speed up startup?

Posted by jone <jo...@yahoo.com.cn>.
hi,all

Every time I startup my app based tapestry 4.x,It always spend much time on 
startup and page/component's loading!

I think there are at least two way to solve: 

1.Remove hivemind dependency.
2.Serialize the parsed page and component.

but,how can do?Could somebody give me a hand.
(I'am regret my poor Enlish.)
thans 
jone


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


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

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-955?page=all ]

Jesse Kuhnert reassigned TAPESTRY-955:
--------------------------------------

    Assign To: Jesse Kuhnert

> 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

>
> 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


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

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
     [ 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