On Monday, February 26, 2018 at 8:27:25 AM UTC, Jun Omae wrote:
>
> Hi, 
>
> On Fri, Feb 23, 2018 at 9:00 PM, Velu Narasimman <velavasim...@gmail.com> 
> wrote: 
> >     I am working with a project developed using trac. I have learned 
> upto 
> > making a plugin. All static content in our project are served with out 
> > caching. So more request are hitting the server. How can I set "Expires" 
> > header so that the static files are cached in end user's browser? Please 
> > give me some code samples showing how and where exactly can I set the 
> > "Expires" header for CSS, JS files that are served from the plugin by 
> trac. 
> > 
> >     I have came across the req.send_header() method but not sure how I 
> can 
> > set it for static files! so please help me on this. 
>
> It would be easy to use mod_expires on Apache rather than setting the 
> header from a plugin. 
>

Yeah, mod_expires seems like the way to go, and there must be something 
similar for Nginx and other webservers.

We do set the Expires header, but I'm unsure of the effect:
https://trac.edgewall.org/browser/tags/trac-1.2.2/trac/web/api.py?marks=685#L682

Perhaps #12964 will eventually be applicable for someone that really want 
to run TracStandalone rather than a third-party webserver and is still 
concerned about the caching policy.
https://trac.edgewall.org/ticket/12964

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to