cache-control

Cache-Control Headers not respected on CloudFlare

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to get some html pages to be cached, the same way images are automatically cached via CloudFlare but I can't get CloudFlare to actually hits its cache for html. According to the documentation (Ref: https://support.cloudflare.com/hc/en-us/articles/202775670-How-Do-I-Tell-CloudFlare-What-to-Cache- ), it's possible to cache anything with a Cache-Control set to public with a max-age greater than 0. I've tried various combinations of headers on my origin Nginx server without success. From a simple Cache-Control: public, max-age

How to configure cache for static resources in web.xml for Jetty?

我的梦境 提交于 2019-12-03 06:19:27
I was reading this: http://docs.codehaus.org/display/JETTY/LastModifiedCacheControl It says The Jetty default servlet allows the cache control header to be set for static content by using the cacheControl init parameter using: <init-param> <param-name>cacheControl</param-name> <param-value>max-age=3600,public</param-value> </init-param> However, I am not sure that I am using the default servlet. At least such configuration is not in web.xml: <web-app> <display-name>Wicket QuickStart</display-name> <context-param> <param-name>configuration</param-name> <param-value>development</param-value> <

Is it fine if first response is private with AppCache (Symfony2)?

让人想犯罪 __ 提交于 2019-12-03 02:31:29
问题 I'm trying to use http caching. In my controller I'm setting a response as follows: $response->setPublic(); $response->setMaxAge(120); $response->setSharedMaxAge(120); $response->setLastModified($lastModifiedAt); dev mode In dev environment first response is a 200 with following headers: cache-control:max-age=120, public, s-maxage=120 last-modified:Wed, 29 Feb 2012 19:00:00 GMT For next 2 minutes every response is a 304 with following headers: cache-control:max-age=120, public, s-maxage=120

Set cache-control for entire S3 bucket automatically (using bucket policies?)

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I need to set cache-control headers for an entire s3 bucket, both existing and future files and was hoping to do it in a bucket policy. I know I can edit the existing ones and I know how to specify them on put if I upload them myself but unfortunately the app that uploads them cannot set the headers as it uses s3fs to copy the files there. 回答1: There are now 3 ways to get this done: via the AWS Console , via the command line , or via the s3cmd command line tool . AWS Console Instructions This is now the recommended solution. It is

How to set HTTP headers (for cache-control)?

匿名 (未验证) 提交于 2019-12-03 01:55:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: How to enable browser caching for my site? Do I just put cache-control:public somewhere up in my header like this? ache-Control:public; > I am using the latest version of PHP developing on the latest version of XAMPP. 回答1: To use cache-control in HTML, you use the meta tag , e.g. The value in the content field is defined as one of the four values below. Some information on the Cache-Control header is as follows HTTP 1.1. Allowed values = PUBLIC | PRIVATE | NO-CACHE | NO-STORE. Public - may be cached in public shared caches. Private

Set Cache-Control on Google Cloud Storage bucket

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a bucket with public images that are frequently updated and would like to disable the default cache duration of 3600. (E.g. "Cache-Control:private, max-age=0, no-transform") Can the Cache-Control be set on a file while uploading it with PHP? Is there a way to set the default Cache-Control for all future files in the bucket (like with ACL that all files are public)? Right now I can only set it Cache-Control with gsutil and only for files currently on storage. 回答1: You can set the Cache-Control while uploading an object - I suggest you

Laravel 5.5 how to set Cache-Control HTTP header globally?

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My Laravel application ist returning Cache-Control: no-cache, private HTTP header by default for each site. How can I change this behaviour? P.S.: It is not a PHP.ini problem, because changing session.cache_limiter to empty/public does not change anything. 回答1: You can have a global middleware for that. something like: <?php namespace App\Http\Middleware; use Closure; class CacheControl { public function handle($request, Closure $next) { $response = $next($request); $response->header('Cache-Control', 'no-cache, must-revalidate'); // Or

Add Cache-Control and Expires headers to Azure Storage Blobs

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using Azure Storage to serve up static file blobs but I'd like to add a Cache-Control and Expires header to the files/blobs when served up to reduce bandwidth costs. Application like CloudXplorer and Cerebrata's Cloud Storage Studio give options to set metadata properties on containers and blobs but get upset when trying to add Cache-Control. Anyone know if it's possible to set these headers for files? 回答1: I had to run a batch job on about 600k blobs and found 2 things that really helped: Running the operation from a worker role in the

Symfony 2 cache clearing issue

狂风中的少年 提交于 2019-12-03 00:52:47
My Symfony 2 website has recently been giving me problems when I try to clear the cache. I type the following command in the terminal: php app/console cache:clear --env=dev And get the following error: [ErrorException] Warning: rename(/var/www/corpsite/corpsite/app/cache/dev,/var/www/corpsite/corpsite/app/cache/dev_old): Directory not empty in /var/www/corpsite/corpsite/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php line 74 So I change the permissions on that file to 777, and re-run the clear cache command, which gives me this error: [ErrorException] Warning:

Is it fine if first response is private with AppCache (Symfony2)?

大兔子大兔子 提交于 2019-12-02 16:01:55
I'm trying to use http caching. In my controller I'm setting a response as follows: $response->setPublic(); $response->setMaxAge(120); $response->setSharedMaxAge(120); $response->setLastModified($lastModifiedAt); dev mode In dev environment first response is a 200 with following headers: cache-control:max-age=120, public, s-maxage=120 last-modified:Wed, 29 Feb 2012 19:00:00 GMT For next 2 minutes every response is a 304 with following headers: cache-control:max-age=120, public, s-maxage=120 This is basically what I expect it to be. prod mode In prod mode response headers are different. Note