When developing a new VTEX IO service, you must define a path so that the service is available to receive requests.
In this article, you will learn about the pattern for service paths according to the desired behavior. To know more about how to implement the path in your app's code, check the guide Developing service configuration apps.
There are three possible path formats, depending on the behavior you wish for your service.
For the purpose of this tutorial, consider you are implementing the service
/examplepath/123. You may change how VTEX handles requests to this service by adding
/_v/private to the beginning of your path. This means you have three possible paths in this example:
- Segment dependant:
VTEX has an edge layer that handles all requests to the platform, including VTEX IO apps, in order to improve performance. Because of this, VTEX will handle requests to each of these possible paths differently when it comes to caching and handling cookies. See the table below.
Learn more about VTEX cookies.
|Path type||Pattern||Cookies behavior||Caching behavior||Example use case|
|Public||There is no guarantee your app will receive the cookies from the request.||VTEX edge will cache your service's response whenever it is possible.||Retrieving information that does not vary according to user or segment, such as product images.|
|Segment dependant||Your app will receive the vtex_segment cookie||VTEX edge will cache your service's response based on the received segment.||Retrieving information that may change depending on the segment. For instance, applying promotions according to the shopper's selected currency.|
|Private||Your app will receive both the vtex_segment and vtex_session cookies.||VTEX will not cache your service's response.||Retrieving information depending on the shopper identity or specific session, such as the shopper's order history or registered addresses.|