I am receiving long waiting times when GETting data and also when posting data to the api
Response times are between 6-11 seconds and the waiting time i get on post requests is around 2 seconds
I am working with Laravel(PHP version of the api). I read about the opt_fields parameter. I am not sure if I am using it incorectly, since it barely took any time of the request times.
This is how I initially fetch my projects, The get Client funtion retieves the acces token of the user and sets the headers asana-disable of new_user_task_lists and new_project_template
getWorkSpaceID is also a function defined by myself that returns the workspace gid
public function show()
{
return (view('dashboard', [
'projects' => $this->getClient()->projects->getProjectsForWorkspace($this->getWorkSpaceID(), ['opt_fields' => 'name']),
'client' => $this->getClient(),
]));
}
In the dashboard I simply work with the data like this(again with the opt_fields parameter)
note: I have taken out some HTML elements since they do not impact this problem and it makes this more readable
@foreach ($projects as $project)
<a class="text-center" href="{{ route('dashboard-project', $project->gid) }}">
<h1 class="text-2xl font-bold">
{{ $project->name }}
</h1>
@foreach ($client->tasks->getTasksForProject($project->gid, ['opt_fields' => 'name']) as $task)
<p class="mt-1 text-center text-lg font-semibold">
{{ $task->name }}
</p>
@foreach ($client->tasks->getSubtasksForTask($task->gid, ['opt_fields' => 'name']) as $subtask)
<p class="text-sm font-light">
{{ $subtask->name }}
</p>
@endforeach
@endforeach
Am I using the opt_fields wrong here? I am receiving no errors. Everything works, I can add tasks aswell. My first thought it was because I am using [âparamâ => âfieldâ]
But this is not the case, since it works fine when adding tasks and subtasks
Is there any way to get faster resonse times?