I personally prefer option 1 as it goes with url's normal practices.

On Wed, Apr 5, 2017 at 2:40 PM, Manuranga Perera <[email protected]> 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 <[email protected]> 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
>> <https://localhost:9292/store/public/components/root/base/js/apis/%7BapiId%7D/index.js>
>>
>> On Wed, Apr 5, 2017 at 11:33 AM, Chanaka Jayasena <[email protected]>
>> 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 <[email protected]>
>>> 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 <[email protected]> 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 : [email protected]
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> [email protected]
>>>>> 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: [email protected]
>>>>
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> [email protected]
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>> Chanaka Jayasena
>>> Associate Tech Lead,
>>> email: [email protected]; cell: +94 77 4464006 <+94%2077%20446%204006>
>>> blog: http://chanaka3d.blogspot.com
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Kasun Thennakoon*
>> Software Engineer
>> WSO2, Inc.
>> Mobile:+94 711661919
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> With regards,
> *Manu*ranga Perera.
>
> phone : 071 7 70 20 50
> mail : [email protected]
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Shazni Nazeer

Mob : +94 777737331
LinkedIn : http://lk.linkedin.com/in/shazninazeer
Blog : http://shazninazeer.blogspot.com

<http://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to