ls -la /page-cache | grep ru
/ru ==> true ,
/ru?any=1 ==> false
GET https://mysite.com/ru?khl-service
А что касательно работы с таблицей юзеров?
class User extends Authenticatable
{
protected $connection='users_connection';
}
class Comment extends Model
{
protected $connection='site_data_connection';
public function users(): HasMany
{
return $this->hasMany(User::class);
}
}
// comments controller
Comment::with('users')->get();
# sql выполняется в разных подключениях
# select * from "comments"
# select * from "users" where "users"."id" in (1, 2)
*/
1. Это не помогло.это всё вместе а не по отдельности.
2. Это очищает весь кэш.
#nginx default
try_files $uri $uri/ /page-cache/$uri.html /page-cache/$uri.json /page-cache/$uri.xml /index.php?$query_string;
function makePreview(mixed $file. int $width){
return CFile::ResizeImageGet($file, ['width'=>$width, 'height'=>10000], BX_RESIZE_IMAGE_PROPORTIONAL, true);
}
//..... a few lines later
$sizes=[600,900,1200];
foreach($sizes as $i=>$width){
makePreview (arItem["PREVIEW_PICTURE"], $width);
}
const data3 = [
{ name: "Андрей", age: 31 },
{ name: "Валерия", age: 31 },
{ name: "Егор", age: 25 },
{ name: "София", age: 29 },
{ name: "Антон", age: 40 },
];
console.log(data3.length)
data3.forEach((item, index)=>{
let maxAge = Math.max(...data3.map((n) => n.age));
if(item.age == maxAge){
console.log(item)
data3.splice(index,1)
}
});
console.log(data3.length)
try:
while True:
data_json = await websocket.receive_json()
# ..... ifs
except ValueError: #json.decoder.JSONDecodeError:
print('bad json')
// где-то в провайдерах
$this->app->bind('InjectedReportTypeResolver ', function ($app) {
return match($app['auth']->getUser()?->role){
null => new NullReportProvider,
'admin' => new FullReportProvider,
default => new DefaultReportProvider
}
});
// web.php
Route::post('/report', 'ReportController@makeReport');
// Controllers
class ReportController{
public function makeReport(ReportFormRequest $request, InjectedReportTypeResolver $resolver){
$reportType = $resolver->resolve($request);
return view($reportType->getViewName(), $reportType->getData());
}
}
// routes/web.php
Route::get('/logout', ['middleware' => 'doNotCacheResponse', 'uses' => 'AuthController@getLogout']);
Route::post('/logout', ['middleware' => 'doNotCacheResponse', 'uses' => 'AuthController@doLogout']);
нанять человека для выполнения задачи.