skip to Main Content

How to force Cache Headers in Laravel

I have a file which I call through the route like this: Route::group([ 'middleware' => ['cache.headers:public;max_age=600'], ], function () { Route::get('/my-file', function ($locale) { //some logic $contents = 'my file content'; $response = Response::make($contents, 200); $response->header('Cache-Control', 'public, max-age=600'); $response->header('Expires', now()->addSeconds(600)->toRfc7231String());…

VIEW QUESTION

How to force JS script update in ASP.NET?

I have a js module, let's call it A. It uses versioning by appending ?v=xxxxxxxxxxxx into its URL (like <script src="/Scripts/A.js?v=637082108844148373"></script>). v changes everytime we make changes in the file. Here is the code: public static class UrlHelperExtensions { public…

VIEW QUESTION

Brower back button issue in wordpress after logout

I am using the below redirect code in the functions.php file. add_action('wp_logout','auto_redirect_after_logout'); function auto_redirect_after_logout(){ $adfsurllogouturl = 'some url'; wp_redirect( $adfsurllogouturl );exit(); } It's working fine. The issue is that once logged out, it redirects to SOMEURL when I click on…

VIEW QUESTION

How to enable browser cache on nginx? – Plesk

I tried to analyze web speed with PageSpeed Insights and Google told me that I need to enable cache. So I added to my .htaccess: <IfModule mod_expires.c> <FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|svg|webp|js|css|swf|gz|json)$"> ExpiresActive On ExpiresDefault A604800 </FilesMatch> </IfModule> <IfModule mod_headers.c> <FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|svg|webp|js|css|swf|gz|json)$"> Header…

VIEW QUESTION
Back To Top
Search