Skip to content

Conversation

@cfmitrah
Copy link
Member

No description provided.

variables.serverTimingHeaders = [];

function addServerTimingHeader(metric, name, timeMs){
arrayAppend(variables.serverTimingHeaders, '"#arguments.name#" - #arguments.metric#=#arguments.timeMs#');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you tried this out in chrome to see if it works?

the format for the server timing headers has changed since my original commit
https://github.com/zspitzer/lucee-loganalyzer/blob/refactoring/source/cfml/plugins/renderUtils.cfc#L54

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can see these in the timing panel when you open a request under network in chrome dev tools

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zspitzer, I'll check it & Let You Know

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cfmitrah is that still ready to go for 5.3? if so can you please redirect it to 6.0. i do not wanna make that kind of change to 5.3

@cfmitrah
Copy link
Member Author

@zspitzer now I saw server timings in chrome dev tool

@micstriit
Copy link
Contributor

There is one problem with this code that need to be addressed and one concern (see tickets for detail).
you cannot do this code in CFML "getPageContext().getHttpServletResponse().isCommitted()", if "direct java access" is disabled in the Security/access Page in the server admin, you will get an exception with that code.
This template should not be affected by different admin settings.

The solution is not to test and simply catch the exception if they occur OR add a function to lucee (isFlushed) that gives this info.

@zspitzer
Copy link
Member

zspitzer commented May 7, 2018 via email

@micstriit
Copy link
Contributor

@zspitzer no there is no isConnected, but i like the idea, i will add both if possible, i'm not sure if the servlet engine is providing that kind of info.
I know that not all servlet engine are handling this in the same way. Some are stopping the request when the client disconnect, some don't.

@micstriit
Copy link
Contributor

every function we add brings the risk to break code in case user have the same function already in use. So instead of having 2 functions i prefer to have only one GetContextInfo():{flushed:...,connected:...}

@micstriit
Copy link
Contributor

@micstriit
Copy link
Contributor

added getContextInfo https://luceeserver.atlassian.net/browse/LDEV-1866 (ATM only provide flushed, more to come), can you adapt this function?

@zspitzer
Copy link
Member

I've been following the Firefox implementation of this, they mentioned Trailer headers

https://bugzilla.mozilla.org/show_bug.cgi?id=1403051
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer

@michaeloffner
Copy link
Contributor

@zspitzer what is the status on this?

@michaeloffner
Copy link
Contributor

this is very old if this still makes sense @cfmitrah @zspitzer please make a PR for Lucee 6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants