Jump to content

htaccess for IPS Forums


Tarun

Recommended Posts

Posted

Your forum root would be the /forums directory. Just like how here the address is invisionpower.com/forums - you'd put it in that forum folder.

No, there's no difference in now/access. They are quite literally the same thing. See Caching Directive bases.

Posted

Ok. Since upgrading I have been using this

FileETag None
<IfModule mod_deflate.c> 
<filesMatch ".(css|js|x?html?|php)$">
    SetOutputFilter DEFLATE
  </filesMatch>
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "now plus 1 week"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-javascript "access plus 1 week"
ExpiresByType application/x-shockwave-flash "access plus 1 week"
ExpiresByType video/x-flv "access plus 1 week"
ExpiresByType application/pdf "access plus 1 week"
ExpiresByType text/xml "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType font/woff "access plus 1 month"
ExpiresByType application/font-woff2 "access plus 1 year"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
</IfModule>

Is there any benefit in swapping this for your code? I only ask due to lack of knowledge

  • 4 weeks later...
Posted (edited)

These expires (not just yours, in general) create an issue with opcache, I and many of my members appear to be logged out and are not seeing updated topics (we're not, needs a page refresh to show as logged in and show the latest topic list). This only happens when opcache is enabled, so it is clashing somewhere. In which case, how do I have working image expires when I have opcache active?

Edited by marklcfc
Posted (edited)

It seems to be ExpiresDefault "now plus 1 hour" that is the problem when opcache is active, it messes things up. Am I ok to remove that or does it defeat the object? As it works fine when that line isn't there.

Edited by marklcfc
  • 6 months later...
Posted

Thanks for this code I will test it out today, there shouldnt be any issues with v4.1.19.4?

And just to confirm I just add this code to my /forums/ directory?

Posted

Works fine with IPS Forums 4.1.x.

Yes,  just add into your /forums/ directory. If you have any issues let me know.

  • 1 month later...
Posted (edited)

I have just started using this one which i found on another site. Any suggestions with this one considering i have also just started using http2?

<IfModule mod_expires.c>

	ExpiresActive on
	ExpiresDefault                                    "access plus 1 month"
	
	# DATA
	ExpiresByType text/xml                            "access plus 0 seconds"
	ExpiresByType text/html                           "access plus 0 seconds"
	ExpiresByType text/plain                          "access plus 0 seconds"
	ExpiresByType application/xml                     "access plus 0 seconds"
	ExpiresByType application/json                    "access plus 0 seconds"
	ExpiresByType application/rss+xml                 "access plus 1 hour"
	ExpiresByType application/atom+xml                "access plus 1 hour"
	ExpiresByType text/x-component                    "access plus 1 hour"
	
	# MANIFEST
	ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
	ExpiresByType text/cache-manifest                 "access plus 0 seconds"
	
	# SCRIPTS
	ExpiresByType text/css                            "access plus 1 month" 
	ExpiresByType text/javascript                     "access plus 1 month" 
	ExpiresByType application/javascript              "access plus 1 month" 
	ExpiresByType application/x-javascript            "access plus 1 month" 
	
	# IMAGES
	ExpiresByType image/gif                           "access plus 1 month"
	ExpiresByType image/png                           "access plus 1 month"
	ExpiresByType image/jpe                           "access plus 1 month"
	ExpiresByType image/jpg                           "access plus 1 month"
	ExpiresByType image/jpeg                          "access plus 1 month"
	ExpiresByType image/jp2                           "access plus 1 month"
	ExpiresByType image/pipeg                         "access plus 1 month"
	ExpiresByType image/bmp                           "access plus 1 month"
	ExpiresByType image/tiff                          "access plus 1 month"
	ExpiresByType image/svg+xml                       "access plus 1 month"
	ExpiresByType image/vnd.microsoft.icon            "access plus 1 month"
	
	# ICONS
	ExpiresByType image/ico                           "access plus 1 month"
	ExpiresByType image/icon                          "access plus 1 month"
	ExpiresByType text/ico                            "access plus 1 month"
	ExpiresByType image/x-ico                         "access plus 1 month"
	ExpiresByType image/x-icon                        "access plus 1 month"
	ExpiresByType application/ico                     "access plus 1 month"
	
	# AUDIO
	ExpiresByType audio/ogg                           "access plus 1 month"
	ExpiresByType audio/basic                         "access plus 1 month"
	ExpiresByType audio/mid                           "access plus 1 month"
	ExpiresByType audio/midi                          "access plus 1 month"
	ExpiresByType audio/mpeg                          "access plus 1 month"
	ExpiresByType audio/x-aiff                        "access plus 1 month"
	ExpiresByType audio/x-mpegurl                     "access plus 1 month"
	ExpiresByType audio/x-pn-realaudio                "access plus 1 month"
	ExpiresByType audio/x-wav                         "access plus 1 month"
	
	# VIDEO
	ExpiresByType video/ogg                           "access plus 1 month"
	ExpiresByType video/mp4                           "access plus 1 month"
	ExpiresByType video/webm                          "access plus 1 month"
	ExpiresByType video/x-msvideo                     "access plus 1 month"
	ExpiresByType video/mpeg                          "access plus 1 month"
	ExpiresByType video/quicktime                     "access plus 1 month"
	ExpiresByType video/x-la-asf                      "access plus 1 month"
	ExpiresByType video/x-ms-asf                      "access plus 1 month"
	ExpiresByType x-world/x-vrml                      "access plus 1 month"
	
	# FONTS
	ExpiresByType font/truetype                       "access plus 1 month"
	ExpiresByType font/opentype                       "access plus 1 month"
	ExpiresByType application/x-font-ttf              "access plus 1 month"
	ExpiresByType application/x-font-woff             "access plus 1 month"
	ExpiresByType application/font-woff               "access plus 1 month"
	ExpiresByType application/vnd.ms-fontobject       "access plus 1 month"
	
	# FLASH
	ExpiresByType application/x-shockwave-flash       "access plus 1 month"
	ExpiresByType video/x-flv                         "access plus 1 month"
	
	# OTHERS
	ExpiresByType application/pdf                     "access plus 1 month"
	ExpiresByType image/vnd.wap.wbmp                  "access plus 1 month"
	ExpiresByType application/vnd.wap.wbxml           "access plus 1 month"
	ExpiresByType application/smil                    "access plus 1 month"
	
	<IfModule mod_headers.c>
		Header append Cache-Control "public"
	</IfModule>
	
</IfModule>

 

Edited by gavpedz
  • 8 months later...
  • 3 weeks later...
  • 9 months later...
Posted

No updates have actually been made. I've simply checked the generated IPS 4.4 .htaccess for changes.

The file is fully 4.4 compatible.

Posted

Just a friendly reminder and clarification. I only offer support here in this thread for the htaccess instead of via PM.

This is because if someone else has the same issues, Instead of having someone who may search for the answer and not be able to find it because it was done via PM.

I want that information to be publicly available and allow for quick resolutions for those who may encounter similar issues.

 

Thanks

  • 1 year later...
  • 1 month later...
Posted

Unfortunately this file where I flagged that it's compatible with the 4.5 release is being rejected. 😞

There have been no changes to the htaccess since June 15, 2016. The only thing that has is simply marking the compatibility with the 4.5 release of the forums.

I'm working to see if I can resolve this issue.

  • 2 weeks later...
  • 9 months later...
Posted

Just a quick suggestion for anyone who uses cloudflare or another CDN, dont use this .htaccess it will cause conflict and your site performance will drop dramatically! i tested it against the standard htaccess and perfermonce went from 93 down to 65.

  • 4 weeks later...
Posted
On 7/28/2021 at 3:52 PM, CyanideBurial said:

Just a quick suggestion for anyone who uses cloudflare or another CDN, dont use this .htaccess it will cause conflict and your site performance will drop dramatically! i tested it against the standard htaccess and perfermonce went from 93 down to 65.

It'd be great if you could mention what lines are causing the issue/conflict.

  • 2 months later...
  • 1 year later...
Posted

Caching JS is causing issues with CKeditor not loading properly, it needs a reload on browser.

Anyone experiencing this?

I noticed on this community that "/applications/core/interface/ckeditor/ckeditor/config.js" must load every time and should not be cached.

Am I correct?

Posted (edited)

Typically I've only seen that issue when using Rocket loader in Cloudflare.  

IPS does not set a cache control header on the file, so Cloudfront does not cache it.  Cloudfront is literally checking ONLY the headers to determine cachability.  Cloudflare is different in that it try to intelligently determine what is catchable.  

With that being said...  I don't think cache status is your problem.  It appearing only on a reload is not a cache issue.  

Per CF's docs:

Quote

Rocket Loader prioritizes your website’s content (text, images, fonts, and more) by deferring the loading of all of your JavaScript until after rendering.

This type of loading (known as asynchronous loading) leads to earlier rendering of your page content. Rocket Loader handles both inline and external scripts, while maintaining order of execution. Cloudflare will detect incompatible browsers and disable Rocket Loader.

I would try checking to see if you have Rocket loader enabled and if so, disable it.  My guess is that is your problem and why a reload fixes your problem because other objects are loaded into the browser cache and therefore are not impacted by Rocket Loader on the subsequent reload of the page.  

Once disabled, flush cache in CF, dump your browser cache, and try again.  

By the way...  not sure I understand why you posted your question in this year old thread that does not seem to be related?

Edited by Randy Calvert
Posted
On 11/24/2022 at 4:05 AM, Randy Calvert said:

By the way...  not sure I understand why you posted your question in this year old thread that does not seem to be related?

I was setting the caching directives for Apache, so I found this topic.

My community is not using Cloudflare, but Cloudfront.

I still could not realize how to set the caching on the CDN and on the browser to make config.js loads every time.

  • 2 months later...
Posted
On 5/11/2015 at 1:16 AM, Tarun said:

This is a custom .htaccess to use on the IPS Community Suite Forums. It helps to improve your forums Google Page Speed and YSlow scores.

The top segment is the same .htaccess that is generated by the IPS Forum software.

The bottom segment is based upon research of several websites and the references listed below. Please be careful when using this file because the contents may be incompatible with your server setup. Preventative measures have been taken to ensure that it should be safe to use in any Apache based environment.

Google recommends a minimum of one week: https://developers.google.com/speed/docs/insights/LeverageBrowserCaching
GTmetrix recommends a minimum of one month: http://gtmetrix.com/leverage-browser-caching.html

 

This file is provided as-is and works with Apache based systems only. Server configurations may vary and there may be unexpected results, preventative measures have been included to try and keep any problems from occurring.

This resource is not supported. Help will be offered to the best of my ability and the community's help and feedback are welcomed. Contributions to improve the overall performance gained by this file are encouraged.

 

Hi please reupload file. Thanks

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...