Re: [Dev] [C5] [APIM] [UUF] Dynamic URLs to static resources

2017-04-05 Thread Shazni Nazeer
I personally prefer option 1 as it goes with url's normal practices.

On Wed, Apr 5, 2017 at 2:40 PM, Manuranga Perera  wrote:

> Hi ,
> You are correct about the caching, it's not a issue since values are not
> changing. But it still seems odd to see { and } and upper case in URLs that
> is visible to the end-user. Like Chanaka said we just need to agree on a
> convention.
>
> How about ... (in the order of my personal preference)
>
> Option 0
> /store/public/components/root/base/js/apis/{apiId}/index.js
> Keep doing what we are doing.
>
> Option 1
> /store/public/components/root/base/js/apis/api-id/index.js
> Omit the { and } from name and CamalCase -> dash.
>
> Option 2
> /store/public/components/root/base/js/apis/api/index.js
> Put what {apiId} represent, in this case it's api.
>
> Option 3
> /store/public/components/root/base/js/apis/api/swagger.js
> /store/public/components/root/base/js/apis/api/doc.js
> Putting a name depending on what it does + option 2.
>
> What do you guys think?
>
> On Wed, Apr 5, 2017 at 7:36 AM, Kasun Thennakoon  wrote:
>
>> Hi Manu,
>>
>> As mentioned above we have used the pattern(/apis/*{apiId}*/index.js)
>> for static JS path, to make it easy for devs to identify which page is
>> using this static resource.
>> I hope what you are referring to as Dynamic URL is the segment /*{apiId}*/,
>> as for backend JS file this placeholder value will be a change for each
>> HTTP request depending on the UUID of the API. But since this pattern has
>> been used in front-end JS file resource path, I don't think this(
>> *{apiId}*) URL[2] segment will change dynamically, making it hard for
>> caching in the browser.
>> I checked with the latest APIM 3.0 m2 release, How the URL for this
>> static JS is generating from UUF. it seems that URL[3] for the index.js
>> remains unchanged for any API and Since the URL kept unchanged between
>> different API overview pages, the index.js file has served from cache[1]
>> for consequent requests.
>> Please correct me if the above behavior is incorrect for aforementioned
>> JS file.
>>
>> Regards
>> ~KasunTe
>>
>> [1] :
>> [image: Inline image 2]
>>
>> [2]:
>>
>> [image: Inline image 1]
>>
>> [3]:
>> /store/public/components/root/base/js/apis/{apiId}/index.js
>> 
>>
>> On Wed, Apr 5, 2017 at 11:33 AM, Chanaka Jayasena 
>> wrote:
>>
>>> Hi Manu,
>>>
>>> As Thilini said we wanted to have a naming convention to identify and
>>> locate client side js files matching the handlebar templates easily.
>>>
>>> thanks,
>>> Chanaka
>>>
>>> On Wed, Apr 5, 2017 at 11:13 AM, Thilini Shanika 
>>> wrote:
>>>
 Hi Manu,

 We used this URL pattern as a convention so that one can easily
 identify the front end js file which is included in each page (Page:
 /apis/{apiID}/ and corresponding frontend js URL :
 public/js/apis/{apiID}/index.js)

 Are there any drawbacks of using this? If there are drawbacks we'll fix
 this.

 @Chanaka & Kasun
 Do you have anything to add?


 Thanks
 Thilini

 On Tue, Apr 4, 2017 at 6:31 PM, Manuranga Perera  wrote:

> I was wondering why dynamic URL's are used to server static content
> [1]. It will prevent the browser caching them effectively and I don't see
> any advantage since it's static file.
>
> Can someone please explain
>
> [1] https://github.com/wso2/carbon-apimgt/blob/master/components
> /web/apps/org.wso2.carbon.apimgt.store/src/main/public/js/ap
> is/%7BapiId%7D/index.js
>
> --
> With regards,
> *Manu*ranga Perera.
>
> phone : 071 7 70 20 50
> mail : m...@wso2.com
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --
 Thilini Shanika
 Senior Software Engineer
 WSO2, Inc.; http://wso2.com
 20, Palmgrove Avenue, Colombo 3

 E-mail: tgtshan...@gmail.com


 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> Chanaka Jayasena
>>> Associate Tech Lead,
>>> email: chan...@wso2.com; cell: +94 77 4464006 <+94%2077%20446%204006>
>>> blog: http://chanaka3d.blogspot.com
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Kasun Thennakoon*
>> Software Engineer
>> WSO2, Inc.
>> Mobile:+94 711661919
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> With regards,
> *Manu*ranga Perera.
>
> phone : 071 7 70 20 50
> mail : m...@wso2.com
>
> 

Re: [Dev] [C5] [APIM] [UUF] Dynamic URLs to static resources

2017-04-05 Thread Manuranga Perera
Hi ,
You are correct about the caching, it's not a issue since values are not
changing. But it still seems odd to see { and } and upper case in URLs that
is visible to the end-user. Like Chanaka said we just need to agree on a
convention.

How about ... (in the order of my personal preference)

Option 0
/store/public/components/root/base/js/apis/{apiId}/index.js
Keep doing what we are doing.

Option 1
/store/public/components/root/base/js/apis/api-id/index.js
Omit the { and } from name and CamalCase -> dash.

Option 2
/store/public/components/root/base/js/apis/api/index.js
Put what {apiId} represent, in this case it's api.

Option 3
/store/public/components/root/base/js/apis/api/swagger.js
/store/public/components/root/base/js/apis/api/doc.js
Putting a name depending on what it does + option 2.

What do you guys think?

On Wed, Apr 5, 2017 at 7:36 AM, Kasun Thennakoon  wrote:

> Hi Manu,
>
> As mentioned above we have used the pattern(/apis/*{apiId}*/index.js) for
> static JS path, to make it easy for devs to identify which page is using
> this static resource.
> I hope what you are referring to as Dynamic URL is the segment /*{apiId}*/,
> as for backend JS file this placeholder value will be a change for each
> HTTP request depending on the UUID of the API. But since this pattern has
> been used in front-end JS file resource path, I don't think this(*{apiId}*)
> URL[2] segment will change dynamically, making it hard for caching in the
> browser.
> I checked with the latest APIM 3.0 m2 release, How the URL for this static
> JS is generating from UUF. it seems that URL[3] for the index.js remains
> unchanged for any API and Since the URL kept unchanged between different
> API overview pages, the index.js file has served from cache[1] for
> consequent requests.
> Please correct me if the above behavior is incorrect for aforementioned JS
> file.
>
> Regards
> ~KasunTe
>
> [1] :
> [image: Inline image 2]
>
> [2]:
>
> [image: Inline image 1]
>
> [3]:
> /store/public/components/root/base/js/apis/{apiId}/index.js
> 
>
> On Wed, Apr 5, 2017 at 11:33 AM, Chanaka Jayasena 
> wrote:
>
>> Hi Manu,
>>
>> As Thilini said we wanted to have a naming convention to identify and
>> locate client side js files matching the handlebar templates easily.
>>
>> thanks,
>> Chanaka
>>
>> On Wed, Apr 5, 2017 at 11:13 AM, Thilini Shanika 
>> wrote:
>>
>>> Hi Manu,
>>>
>>> We used this URL pattern as a convention so that one can easily identify
>>> the front end js file which is included in each page (Page: /apis/{apiID}/
>>> and corresponding frontend js URL : public/js/apis/{apiID}/index.js)
>>>
>>> Are there any drawbacks of using this? If there are drawbacks we'll fix
>>> this.
>>>
>>> @Chanaka & Kasun
>>> Do you have anything to add?
>>>
>>>
>>> Thanks
>>> Thilini
>>>
>>> On Tue, Apr 4, 2017 at 6:31 PM, Manuranga Perera  wrote:
>>>
 I was wondering why dynamic URL's are used to server static content
 [1]. It will prevent the browser caching them effectively and I don't see
 any advantage since it's static file.

 Can someone please explain

 [1] https://github.com/wso2/carbon-apimgt/blob/master/components
 /web/apps/org.wso2.carbon.apimgt.store/src/main/public/js/ap
 is/%7BapiId%7D/index.js

 --
 With regards,
 *Manu*ranga Perera.

 phone : 071 7 70 20 50
 mail : m...@wso2.com

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> Thilini Shanika
>>> Senior Software Engineer
>>> WSO2, Inc.; http://wso2.com
>>> 20, Palmgrove Avenue, Colombo 3
>>>
>>> E-mail: tgtshan...@gmail.com
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Chanaka Jayasena
>> Associate Tech Lead,
>> email: chan...@wso2.com; cell: +94 77 4464006 <+94%2077%20446%204006>
>> blog: http://chanaka3d.blogspot.com
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Kasun Thennakoon*
> Software Engineer
> WSO2, Inc.
> Mobile:+94 711661919
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
With regards,
*Manu*ranga Perera.

phone : 071 7 70 20 50
mail : m...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [C5] [APIM] [UUF] Dynamic URLs to static resources

2017-04-05 Thread Kasun Thennakoon
Hi Manu,

As mentioned above we have used the pattern(/apis/*{apiId}*/index.js) for
static JS path, to make it easy for devs to identify which page is using
this static resource.
I hope what you are referring to as Dynamic URL is the segment /*{apiId}*/,
as for backend JS file this placeholder value will be a change for each
HTTP request depending on the UUID of the API. But since this pattern has
been used in front-end JS file resource path, I don't think this(*{apiId}*)
URL[2] segment will change dynamically, making it hard for caching in the
browser.
I checked with the latest APIM 3.0 m2 release, How the URL for this static
JS is generating from UUF. it seems that URL[3] for the index.js remains
unchanged for any API and Since the URL kept unchanged between different
API overview pages, the index.js file has served from cache[1] for
consequent requests.
Please correct me if the above behavior is incorrect for aforementioned JS
file.

Regards
~KasunTe

[1] :
[image: Inline image 2]

[2]:

[image: Inline image 1]

[3]:
/store/public/components/root/base/js/apis/{apiId}/index.js


On Wed, Apr 5, 2017 at 11:33 AM, Chanaka Jayasena  wrote:

> Hi Manu,
>
> As Thilini said we wanted to have a naming convention to identify and
> locate client side js files matching the handlebar templates easily.
>
> thanks,
> Chanaka
>
> On Wed, Apr 5, 2017 at 11:13 AM, Thilini Shanika 
> wrote:
>
>> Hi Manu,
>>
>> We used this URL pattern as a convention so that one can easily identify
>> the front end js file which is included in each page (Page: /apis/{apiID}/
>> and corresponding frontend js URL : public/js/apis/{apiID}/index.js)
>>
>> Are there any drawbacks of using this? If there are drawbacks we'll fix
>> this.
>>
>> @Chanaka & Kasun
>> Do you have anything to add?
>>
>>
>> Thanks
>> Thilini
>>
>> On Tue, Apr 4, 2017 at 6:31 PM, Manuranga Perera  wrote:
>>
>>> I was wondering why dynamic URL's are used to server static content [1].
>>> It will prevent the browser caching them effectively and I don't see any
>>> advantage since it's static file.
>>>
>>> Can someone please explain
>>>
>>> [1] https://github.com/wso2/carbon-apimgt/blob/master/components
>>> /web/apps/org.wso2.carbon.apimgt.store/src/main/public/js/
>>> apis/%7BapiId%7D/index.js
>>>
>>> --
>>> With regards,
>>> *Manu*ranga Perera.
>>>
>>> phone : 071 7 70 20 50
>>> mail : m...@wso2.com
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Thilini Shanika
>> Senior Software Engineer
>> WSO2, Inc.; http://wso2.com
>> 20, Palmgrove Avenue, Colombo 3
>>
>> E-mail: tgtshan...@gmail.com
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Chanaka Jayasena
> Associate Tech Lead,
> email: chan...@wso2.com; cell: +94 77 4464006 <+94%2077%20446%204006>
> blog: http://chanaka3d.blogspot.com
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Kasun Thennakoon*
Software Engineer
WSO2, Inc.
Mobile:+94 711661919
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [C5] [APIM] [UUF] Dynamic URLs to static resources

2017-04-05 Thread Chanaka Jayasena
Hi Manu,

As Thilini said we wanted to have a naming convention to identify and
locate client side js files matching the handlebar templates easily.

thanks,
Chanaka

On Wed, Apr 5, 2017 at 11:13 AM, Thilini Shanika  wrote:

> Hi Manu,
>
> We used this URL pattern as a convention so that one can easily identify
> the front end js file which is included in each page (Page: /apis/{apiID}/
> and corresponding frontend js URL : public/js/apis/{apiID}/index.js)
>
> Are there any drawbacks of using this? If there are drawbacks we'll fix
> this.
>
> @Chanaka & Kasun
> Do you have anything to add?
>
>
> Thanks
> Thilini
>
> On Tue, Apr 4, 2017 at 6:31 PM, Manuranga Perera  wrote:
>
>> I was wondering why dynamic URL's are used to server static content [1].
>> It will prevent the browser caching them effectively and I don't see any
>> advantage since it's static file.
>>
>> Can someone please explain
>>
>> [1] https://github.com/wso2/carbon-apimgt/blob/master/components
>> /web/apps/org.wso2.carbon.apimgt.store/src/main/public/
>> js/apis/%7BapiId%7D/index.js
>>
>> --
>> With regards,
>> *Manu*ranga Perera.
>>
>> phone : 071 7 70 20 50
>> mail : m...@wso2.com
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Thilini Shanika
> Senior Software Engineer
> WSO2, Inc.; http://wso2.com
> 20, Palmgrove Avenue, Colombo 3
>
> E-mail: tgtshan...@gmail.com
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Chanaka Jayasena
Associate Tech Lead,
email: chan...@wso2.com; cell: +94 77 4464006
blog: http://chanaka3d.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [C5] [APIM] [UUF] Dynamic URLs to static resources

2017-04-04 Thread Thilini Shanika
Hi Manu,

We used this URL pattern as a convention so that one can easily identify
the front end js file which is included in each page (Page: /apis/{apiID}/
and corresponding frontend js URL : public/js/apis/{apiID}/index.js)

Are there any drawbacks of using this? If there are drawbacks we'll fix
this.

@Chanaka & Kasun
Do you have anything to add?


Thanks
Thilini

On Tue, Apr 4, 2017 at 6:31 PM, Manuranga Perera  wrote:

> I was wondering why dynamic URL's are used to server static content [1].
> It will prevent the browser caching them effectively and I don't see any
> advantage since it's static file.
>
> Can someone please explain
>
> [1] https://github.com/wso2/carbon-apimgt/blob/master/
> components/web/apps/org.wso2.carbon.apimgt.store/src/main/
> public/js/apis/%7BapiId%7D/index.js
>
> --
> With regards,
> *Manu*ranga Perera.
>
> phone : 071 7 70 20 50
> mail : m...@wso2.com
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Thilini Shanika
Senior Software Engineer
WSO2, Inc.; http://wso2.com
20, Palmgrove Avenue, Colombo 3

E-mail: tgtshan...@gmail.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [C5] [APIM] [UUF] Dynamic URLs to static resources

2017-04-04 Thread Manuranga Perera
I was wondering why dynamic URL's are used to server static content [1]. It
will prevent the browser caching them effectively and I don't see any
advantage since it's static file.

Can someone please explain

[1]
https://github.com/wso2/carbon-apimgt/blob/master/components/web/apps/org.wso2.carbon.apimgt.store/src/main/public/js/apis/%7BapiId%7D/index.js

-- 
With regards,
*Manu*ranga Perera.

phone : 071 7 70 20 50
mail : m...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev