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 <chan...@wso2.com> 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 <thili...@wso2.com>
> 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 <m...@wso2.com> 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

Reply via email to